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/22 13:12:04 UTC

[GitHub] [airflow] ejk43 commented on a diff in pull request #24592: Move fallible ti.task.dag assignment back inside try/except block (#24533)

ejk43 commented on code in PR #24592:
URL: https://github.com/apache/airflow/pull/24592#discussion_r903724941


##########
airflow/providers/elasticsearch/log/es_task_handler.py:
##########
@@ -125,9 +125,9 @@ def _render_log_id(self, ti: TaskInstance, try_number: int) -> str:
             else:
                 log_id_template = self.log_id_template
 
-        dag = ti.task.dag
-        assert dag is not None  # For Mypy.
         try:
+            dag = ti.task.dag
+            assert dag is not None  # For Mypy.
             data_interval: Tuple[datetime, datetime] = dag.get_run_data_interval(dag_run)
         except AttributeError:  # ti.task is not always set.

Review Comment:
   Fair request -- updated



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