Airflow 2.9.1 : AirflowContextDeprecationWarning: Accessing 'yesterday_ds_nodash' from the template is deprecated and will be removed in a future version. #40113
Replies: 6 comments 1 reply
-
Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval. |
Beta Was this translation helpful? Give feedback.
-
Welcome, and thank you for your post!
As it currently seems more of a troubleshooting than a problem that needs fixing, I'm converting this into a Q&A discussion. |
Beta Was this translation helpful? Give feedback.
-
I don't use astronomer. get_current_context() throws this warning on a fresh install from pip on mac in the versions I specified. I posted a reference to deprecated variables in the code.
There is no need to keep this ticket open as QA it doesn't matter to me if you fix it |
Beta Was this translation helpful? Give feedback.
-
Hello, I'm experiencing the same issue here, with 2.9.2. |
Beta Was this translation helpful? Give feedback.
-
Minimal code to reproduce the problem:
|
Beta Was this translation helpful? Give feedback.
-
Closing as I recreated the issue here: #42806. |
Beta Was this translation helpful? Give feedback.
-
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?
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions