airflow

{{ yesterday_ds }} deprecation warning, but what should I be using instead?


I'm using the {{ yesterday_ds }} to get the date of the day before the execution date, just as the documentation mentions. In the logs I see a deprecation warning:

AirflowContextDeprecationWarning: Accessing 'yesterday_ds' from the template is deprecated and will be removed in a future version.

But it is not clear to me what I should be using instead. Any ideas?


Solution

  • You could use macros.ds_add '{{ macros.ds_add(ds, -1) }}'