Re: [DISCUSS] deprecate `days_ago` dates utility

2022-02-01 Thread Jarek Potiuk
Good point Bas. While I am all for deprecation, I agree this one is very much "hard-wired" into many users of Airflow, for many likely this is almost a muscle-memory or copying from existing DAGs. It's not enough to mandate it but we also should be empathetic and provide a viable replacement. Un

Re: [DISCUSS] deprecate `days_ago` dates utility

2022-02-01 Thread Bas Harenslak
Regardless the behaviour of days_ago(), a lot of people use it so we’ll definitely need to document it well with some good examples of alternatives. That said, I think the usage of days_ago() is actually a side-effect of users that don’t really need their DAGs to start at X days ago, but want th

Re: [DISCUSS] deprecate `days_ago` dates utility

2022-01-31 Thread Tzu-ping Chung
I was brought here by https://github.com/apache/airflow/pull/20508#issuecomment-1026414890 Also +1 to deprecation from me. Since the function cannot be safely used in start_date and end_date, the only sensible way for a general, non-advanced user to use the function is in a task Python callable

Re: [DISCUSS] deprecate `days_ago` dates utility

2022-01-05 Thread Josh Fell
+1 for deprecation as well. `days_ago()` was removed from example DAGs and other documentation since it was mainly being used for dynamic `start_date` values which is not a best practice in DAG authoring. Seemed to create more confusion and odd behavior than value. On Tue, Dec 28, 2021 at 7:00 PM

Re: [DISCUSS] deprecate `days_ago` dates utility

2021-12-28 Thread Jarek Potiuk
I'd be for deprecating it. It's too easy to use with too much too loose and too little value. I see no real "business" value in it. On Tue, Dec 28, 2021 at 5:27 PM Daniel Standish wrote: > > Yeah that's correct. Sorry, I should have used `pendulum.today`. But yeah > also equivalent to `pendulu

Re: [DISCUSS] deprecate `days_ago` dates utility

2021-12-28 Thread Daniel Standish
Yeah that's correct. Sorry, I should have used `pendulum.today`. But yeah also equivalent to `pendulum.today('UTC').add(days=-N)` *(while `days_ago` uses timedelta it's the same when there's no DST is involved)* On Tue, Dec 28, 2021, 1:59 AM Ash Berlin-Taylor wrote: > days_ago is not just the

Re: [DISCUSS] deprecate `days_ago` dates utility

2021-12-28 Thread Ash Berlin-Taylor
days_ago is not just the same as utcnow minus N days, it is always "truncated" to the start of the day, so it's closer to "utcnow().replace(hour=0, minute=0, second=0) - timedelta(n)” On 28 December 2021 00:08:53 GMT, Daniel Standish wrote: >I recall some time ago we removed `days_ago` from a

[DISCUSS] deprecate `days_ago` dates utility

2021-12-27 Thread Daniel Standish
I recall some time ago we removed `days_ago` from all example dags. Not sure why we didn't also deprecate it. For reference, `days_ago(N)` returns utcnow minus N days. There's a PR to make it return a value in the default timezone, so that when you use it in an expression for dag `start_date`,