You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "hpaluch-pil (via GitHub)" <gi...@apache.org> on 2026/06/17 11:34:46 UTC
Re: [I] Add prev_ds and prev_ds_nodash back to the standard macros and do not deprecate them [airflow]
hpaluch-pil commented on issue #49073:
URL: https://github.com/apache/airflow/issues/49073#issuecomment-4729468840
I use following kludge as replacement (you may need to adjust `macros.ds_add()` offset for your case):
* AirFlow 2.x: `{{ prev_ds }}`
* AirFlow 3.x: `{{ prev_start_date_success | ds if prev_start_date_success is not none else macros.ds_add(logical_date | ds , -1) }}`
That `.. if .. else ..` is required because when `prev_start_date_success` is `None` it will crash `ds` converter.
I fully agree with @itsCodyBo view - that there was no sensible reason to drop such useful macros. Note that even 3.x docs still mention them in several places - adding to more confusion (for users that are not aware that `prev_ds` no longer exists) - for example: https://github.com/apache/airflow/blob/main/airflow-core/docs/faq.rst contains:
> Why next_ds or prev_ds might not contain expected values?
Reference commit (note that message does not mention removal of these macros...): https://github.com/apache/airflow/commit/123dadda0e0648ef1412053d1743128333eecb63
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org