Skip to content

Airflow 2.9.1 : AirflowContextDeprecationWarning: Accessing 'yesterday_ds_nodash' from the template is deprecated and will be removed in a future version. #40100

@michaelritsema

Description

@michaelritsema

Apache Airflow version

2.9.1

If "Other Airflow 2 version" selected, which one?

No response

What happened?

related: #20603

I installed from PIP and in development mode on a mac. I'm experiencing this same issue when calling get_context()

I'm new to airflow but it seems like there are still references to this in the code:

class _BasePythonVirtualenvOperator(PythonOperator, metaclass=ABCMeta):
BASE_SERIALIZABLE_CONTEXT_KEYS = {
"ds",
"ds_nodash",
"expanded_ti_count",
"inlets",
"map_index_template",
"next_ds",
"next_ds_nodash",
"outlets",
"prev_ds",
"prev_ds_nodash",
"run_id",
"task_instance_key_str",
"test_mode",
"tomorrow_ds",
"tomorrow_ds_nodash",
"ts",
"ts_nodash",
"ts_nodash_with_tz",
"yesterday_ds",
"yesterday_ds_nodash",
}

expanded log:

/Users/mr/airflow/lib/python3.11/site-packages/airflow/utils/context.py:212 AirflowContextDeprecationWarning: Accessing 'execution_date' from the template is deprecated and will be removed in a future version. Please use 'data_interval_start' or 'logical_date' instead.
/Users/mr/airflow/lib/python3.11/site-packages/airflow/utils/context.py:212 AirflowContextDeprecationWarning: Accessing 'next_ds' from the template is deprecated and will be removed in a future version. Please use '{{ data_interval_end | ds }}' instead.
/Users/mr/airflow/lib/python3.11/site-packages/airflow/utils/context.py:212 AirflowContextDeprecationWarning: Accessing 'next_ds_nodash' from the template is deprecated and will be removed in a future version. Please use '{{ data_interval_end | ds_nodash }}' instead.
/Users/mr/airflow/lib/python3.11/site-packages/airflow/utils/context.py:212 AirflowContextDeprecationWarning: Accessing 'next_execution_date' from the template is deprecated and will be removed in a future version. Please use 'data_interval_end' instead.
/Users/mr/airflow/lib/python3.11/site-packages/airflow/utils/context.py:212 AirflowContextDeprecationWarning: Accessing 'prev_ds' from the template is deprecated and will be removed in a future version.
/Users/mr/airflow/lib/python3.11/site-packages/airflow/utils/context.py:212 AirflowContextDeprecationWarning: Accessing 'prev_ds_nodash' from the template is deprecated and will be removed in a future version.
/Users/mr/airflow/lib/python3.11/site-packages/airflow/utils/context.py:212 AirflowContextDeprecationWarning: Accessing 'prev_execution_date' from the template is deprecated and will be removed in a future version.
/Users/mr/airflow/lib/python3.11/site-packages/airflow/utils/context.py:212 AirflowContextDeprecationWarning: Accessing 'prev_execution_date_success' from the template is deprecated and will be removed in a future version. Please use 'prev_data_interval_start_success' instead.
/Users/mr/airflow/lib/python3.11/site-packages/airflow/utils/context.py:212 AirflowContextDeprecationWarning: Accessing 'tomorrow_ds' from the template is deprecated and will be removed in a future version.
/Users/mr/airflow/lib/python3.11/site-packages/airflow/utils/context.py:212 AirflowContextDeprecationWarning: Accessing 'tomorrow_ds_nodash' from the template is deprecated and will be removed in a future version.
/Users/mr/airflow/lib/python3.11/site-packages/airflow/utils/context.py:212 AirflowContextDeprecationWarning: Accessing 'yesterday_ds' from the template is deprecated and will be removed in a future version.
/Users/mr/airflow/lib/python3.11/site-packages/airflow/utils/context.py:212 AirflowContextDeprecationWarning: Accessing 'yesterday_ds_nodash' from the template is deprecated and will be removed in a future version.

What you think should happen instead?

No response

How to reproduce

any call to get_context()

Operating System

Sonoma 14.5

Versions of Apache Airflow Providers

airflow-clickhouse-plugin==1.3.0
apache-airflow==2.9.1
apache-airflow-providers-common-io==1.3.2
apache-airflow-providers-common-sql==1.14.0
apache-airflow-providers-fab==1.1.1
apache-airflow-providers-ftp==3.9.1
apache-airflow-providers-http==4.11.1
apache-airflow-providers-imap==3.6.1
apache-airflow-providers-smtp==1.7.1
apache-airflow-providers-sqlite==3.8.1

Deployment

Astronomer

Deployment details

local pip

Anything else?

,

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:corekind:bugThis is a clearly a bugneeds-triagelabel for new issues that we didn't triage yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions