You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "michaelritsema (via GitHub)" <gi...@apache.org> on 2024/06/06 16:10:05 UTC

[I] Airflow 2.9.1 : AirflowContextDeprecationWarning: Accessing 'yesterday_ds_nodash' from the template is deprecated and will be removed in a future version. [airflow]

michaelritsema opened a new issue, #40100:
URL: https://github.com/apache/airflow/issues/40100

   ### 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
   
   - [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Airflow 2.9.1 : AirflowContextDeprecationWarning: Accessing 'yesterday_ds_nodash' from the template is deprecated and will be removed in a future version. [airflow]

Posted by "shahar1 (via GitHub)" <gi...@apache.org>.
shahar1 closed issue #40100:  Airflow 2.9.1 : AirflowContextDeprecationWarning: Accessing 'yesterday_ds_nodash' from the template is deprecated and will be removed in a future version.
URL: https://github.com/apache/airflow/issues/40100


-- 
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


Re: [I] Airflow 2.9.1 : AirflowContextDeprecationWarning: Accessing 'yesterday_ds_nodash' from the template is deprecated and will be removed in a future version. [airflow]

Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on issue #40100:
URL: https://github.com/apache/airflow/issues/40100#issuecomment-2152904238

   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.
   


-- 
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


Re: [I] Airflow 2.9.1 : AirflowContextDeprecationWarning: Accessing 'yesterday_ds_nodash' from the template is deprecated and will be removed in a future version. [airflow]

Posted by "shahar1 (via GitHub)" <gi...@apache.org>.
shahar1 commented on issue #40100:
URL: https://github.com/apache/airflow/issues/40100#issuecomment-2154325679

   Welcome, and thank you for your post!
   The issue that you're trying to address is not clear:
   1. By `get_context()` you mean `get_current_context()`? Do you use it according to the [docs](https://airflow.apache.org/docs/apache-airflow/stable/_api/airflow/operators/python/index.html)?
   2. You specify `Astronomer` as the deployment environment. Do you use their framework or install Airflow otherwise?
   3. Could you please provide an example of a DAG that provides this warning? Does this warning affect the functionality of the DAG?
   
   As it currently seems more of a troubleshooting than a problem that needs fixing, I'm converting this into a Q&A discussion.


-- 
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