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/06/03 18:08:03 UTC

[GitHub] [airflow] jedcunningham commented on a diff in pull request #24153: Apply per-run log templates to log handlers

jedcunningham commented on code in PR #24153:
URL: https://github.com/apache/airflow/pull/24153#discussion_r889213246


##########
airflow/providers/elasticsearch/log/es_task_handler.py:
##########
@@ -103,7 +112,10 @@ def __init__(
         self.handler: Union[logging.FileHandler, logging.StreamHandler]  # type: ignore[assignment]
 
     def _render_log_id(self, ti: TaskInstance, try_number: int) -> str:
-        dag_run = ti.get_dagrun()
+        with create_session() as session:
+            dag_run = ti.get_dagrun(session=session)
+            log_id_template = dag_run.get_log_template(session=session).elasticsearch_id

Review Comment:
   This needs more work to make it backwards compatible, or we bump the min Airflow version.



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