potiuk commented on a change in pull request #22385:
URL: https://github.com/apache/airflow/pull/22385#discussion_r831234670



##########
File path: airflow/providers/elasticsearch/log/es_task_handler.py
##########
@@ -129,7 +129,7 @@ def _render_log_id(self, ti: TaskInstance, try_number: int) 
-> str:
         return self.log_id_template.format(
             dag_id=ti.dag_id,
             task_id=ti.task_id,
-            run_id=ti.run_id,
+            run_id=getattr(ti, "run_id", ""),

Review comment:
       It's only formatting hte log entry so I "guess" it produces proper log 
entry. But good point - I do not know if the es logs will be properly parsed by 
ES engine then (though having unparseable logs is still infintely bettern than 
crashing airflow in this case :D) 

##########
File path: airflow/providers/elasticsearch/log/es_task_handler.py
##########
@@ -129,7 +129,7 @@ def _render_log_id(self, ti: TaskInstance, try_number: int) 
-> str:
         return self.log_id_template.format(
             dag_id=ti.dag_id,
             task_id=ti.task_id,
-            run_id=ti.run_id,
+            run_id=getattr(ti, "run_id", ""),

Review comment:
       It's only formatting hte log entry so I "guess" it produces proper log 
entry. But good point - I do not know if the es logs will be properly parsed by 
ES engine then (though having unparseable logs is still infintely better than 
crashing airflow in this case :D) 




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to