Re: [Tutor] airflow dag

2017-05-28 Thread shubham goyal
Does anybody have answer? On May 27, 2017 1:53 PM, "Cameron Simpson" wrote: > On 25May2017 18:02, Alan Gauld wrote: > >> On 25/05/17 13:15, shubham goyal wrote: >> >>> I want to ask that can we pass the parameters as commandline arguments in >>> airflow when we are triggering the dag and access

Re: [Tutor] airflow dag

2017-05-28 Thread Steven D'Aprano
On Sun, May 28, 2017 at 09:07:10AM +0530, shubham goyal wrote: > Does anybody have answer? Answer to what question? Peter has already answered your question about passing parameters as command line arguments. Do you have another question? -- Steve

Re: [Tutor] airflow dag

2017-05-28 Thread Steven D'Aprano
On Sat, May 27, 2017 at 02:25:24PM +1000, Cameron Simpson wrote: > On 25May2017 18:02, Alan Gauld wrote: > >On 25/05/17 13:15, shubham goyal wrote: > >>I want to ask that can we pass the parameters as commandline arguments in > >>airflow when we are triggering the dag and access them inside the da

Re: [Tutor] airflow dag

2017-05-28 Thread Alan Gauld via Tutor
On 28/05/17 04:37, shubham goyal wrote: > Does anybody have answer? You received two answers, both of which asked you to try something and get back to us for more information. Did you try printing sys.argv? What was the result? And did you try Peter's argparse code? You still haven't explained w

Re: [Tutor] airflow dag

2017-05-28 Thread Francois Dion
My mailbox if full of similar stories: companies dumping airflow on their ETL (or similar) group. Those who knew Python succeeded, those who didn't failed, and some even moved to other companies because they couldn't cope with all this complexity dumped on them all at once. Moral of the story, it

Re: [Tutor] How to deploy seamless script updates to your "clients"?

2017-05-28 Thread Mats Wichmann
On 05/27/2017 05:33 AM, M Hashmi wrote: > That's where Git or other version control systems come in. You can edit or > upgrade creating a branch and when a branch tested at your side. You can > push it with new tag like "some module changed". I guess this is how it > works for everyone. All your te

[Tutor] Counting a string backwards

2017-05-28 Thread C W
Dear Python list, I am having trouble understanding the following. If I do case 1, great = "Machine learning is awesome!" > print(great[-1]) > ! Now if I do case 2, > print(great[-3:-1]) > me Where did the exclamation mark go in case 2? I was told the count begins at zero, that's true going fo

Re: [Tutor] Problem with if statements and else statements

2017-05-28 Thread Mats Wichmann
On 05/27/2017 06:14 PM, boB Stepp wrote: > Hello Jalen! > > On Sat, May 27, 2017 at 4:19 PM, Jalen Barr wrote: >> >> In this code it always changes the PlaceHolder to 0 no matter what Month is >> set to >> >> Month ="September" >> >> if Month == "January" or "1": >> PlaceHolder = 0 > > This

Re: [Tutor] Problem with if statements and else statements

2017-05-28 Thread Alex Kleider
On 2017-05-28 13:13, Mats Wichmann wrote: FWIW, if checking for multiples, you could also write: if Month in ['January', '1']: Would if Month in {'January', '1'}: be even better? (regarding efficiency perhaps? Trivial point, I know, but just wondering.)

Re: [Tutor] Counting a string backwards

2017-05-28 Thread Alan Gauld via Tutor
On 28/05/17 18:58, C W wrote: > Now if I do case 2, >> print(great[-3:-1]) >> me > > Where did the exclamation mark go in case 2? > > I was told the count begins at zero, that's true going forward, but not > backwards. Its not about where the count starts its about where it finishes. It finishe

Re: [Tutor] Problem with if statements and else statements

2017-05-28 Thread Alan Gauld via Tutor
On 29/05/17 00:12, Alex Kleider wrote: > On 2017-05-28 13:13, Mats Wichmann wrote: > >> FWIW, if checking for multiples, you could also write: >> >> if Month in ['January', '1']: > > Would > if Month in {'January', '1'}: > > be even better? (regarding efficiency perhaps? Trivial point, I

Re: [Tutor] Counting a string backwards

2017-05-28 Thread Steven D'Aprano
On Sun, May 28, 2017 at 01:58:22PM -0400, C W wrote: > Dear Python list, > > I am having trouble understanding the following. [...] The way to think about string indexing and slicing is that the index positions mark *between* the characters. Take your string: Machine learning is awesome!

Re: [Tutor] Problem with if statements and else statements

2017-05-28 Thread Peter Otten
Alex Kleider wrote: > On 2017-05-28 13:13, Mats Wichmann wrote: > >> FWIW, if checking for multiples, you could also write: >> >> if Month in ['January', '1']: > > Would > if Month in {'January', '1'}: > > be even better? (regarding efficiency perhaps? Trivial point, I know, > but just

Re: [Tutor] Counting a string backwards

2017-05-28 Thread Peter Otten
Steven D'Aprano wrote: > Because 0 always means the start of the string, how do you slice to the > end? You can use the length of the string (in this case, 7) or you can > leave the ending position blank, and it defaults to the length of the > string: For completeness, there's a third option, Non