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
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
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
+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
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
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
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
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`,