You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/08/17 12:22:26 UTC

[GitHub] [airflow] Taragolis opened a new pull request, #25764: Remove depreciation warning when use default remote tasks logging handlers

Taragolis opened a new pull request, #25764:
URL: https://github.com/apache/airflow/pull/25764

   All of the default remote task handlers which inherited from `FileTaskHandler` pass value from `[logging] log_filename_template` value to class args `filename_template`.
   - airflow.providers.amazon.aws.log.s3_task_handler.S3TaskHandler
   - airflow.providers.amazon.aws.log.cloudwatch_task_handler.CloudwatchTaskHandler
   - airflow.providers.google.cloud.log.gcs_task_handler.GCSTaskHandler
   - airflow.providers.microsoft.azure.log.wasb_task_handler.WasbTaskHandler
   - airflow.providers.alibaba.cloud.log.oss_task_handler.OSSTaskHandler
   - airflow.providers.elasticsearch.log.es_task_handler.ElasticsearchTaskHandler
   
   As result when enabled remote logging (e.g. S3 Logging) quite a few deprecation warnings appear in airflow services logs 
   ```
   /home/airflow/.local/lib/python3.9/site-packages/airflow/utils/log/file_task_handler.py:52 DeprecationWarning: Passing filename_template to FileTaskHandler is deprecated and has no effect
   ```
   
   This handlers do not use internally `filename_template` attribute ( check for `main` and first version of each handlers), so it should be safe set `None` for all of them.
   
   closes: #25743
   related: #24153
   
   cc: @uranusjr 


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


[GitHub] [airflow] uranusjr commented on a diff in pull request #25764: Remove depreciation warning when use default remote tasks logging handlers

Posted by GitBox <gi...@apache.org>.
uranusjr commented on code in PR #25764:
URL: https://github.com/apache/airflow/pull/25764#discussion_r947933943


##########
airflow/config_templates/airflow_local_settings.py:
##########
@@ -56,7 +56,10 @@
     'logging', 'DAG_PROCESSOR_MANAGER_LOG_LOCATION'
 )
 
-FILENAME_TEMPLATE: str = conf.get_mandatory_value('logging', 'LOG_FILENAME_TEMPLATE')
+# FILENAME_TEMPLATE only uses in Remote Logging Handlers since Airflow 2.3.3
+# All of these handlers inherited from FileTaskHandler and providing any value rather than None
+# would raise deprecation warning.
+FILENAME_TEMPLATE: Optional[str] = None

Review Comment:
   It shouldn’t be used anywhere else (should just read from `conf`). This can be removed.



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


[GitHub] [airflow] ephraimbuddy merged pull request #25764: Remove depreciation warning when use default remote tasks logging handlers

Posted by GitBox <gi...@apache.org>.
ephraimbuddy merged PR #25764:
URL: https://github.com/apache/airflow/pull/25764


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


[GitHub] [airflow] Taragolis commented on a diff in pull request #25764: Remove depreciation warning when use default remote tasks logging handlers

Posted by GitBox <gi...@apache.org>.
Taragolis commented on code in PR #25764:
URL: https://github.com/apache/airflow/pull/25764#discussion_r947862914


##########
airflow/config_templates/airflow_local_settings.py:
##########
@@ -56,7 +56,10 @@
     'logging', 'DAG_PROCESSOR_MANAGER_LOG_LOCATION'
 )
 
-FILENAME_TEMPLATE: str = conf.get_mandatory_value('logging', 'LOG_FILENAME_TEMPLATE')
+# FILENAME_TEMPLATE only uses in Remote Logging Handlers since Airflow 2.3.3
+# All of these handlers inherited from FileTaskHandler and providing any value rather than None
+# would raise deprecation warning.
+FILENAME_TEMPLATE: Optional[str] = None

Review Comment:
   I can't find any usage of this variable outside of `airflow/config_templates/airflow_local_settings.py`



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