pankajkoti commented on code in PR #32977:
URL: https://github.com/apache/airflow/pull/32977#discussion_r1397782966


##########
airflow/providers/elasticsearch/log/es_task_handler.py:
##########
@@ -182,8 +183,14 @@ def format_url(host: str) -> str:
 
         return host
 
-    def _render_log_id(self, ti: TaskInstance, try_number: int) -> str:
+    def _render_log_id(self, ti: TaskInstance | TaskInstanceKey, try_number: 
int) -> str:
+        from airflow.models.taskinstance import TaskInstance, TaskInstanceKey
+
         with create_session() as session:
+            if isinstance(ti, TaskInstanceKey):
+                ti = TaskInstance.get_by_key(ti, session)

Review Comment:
   also this is stale code which was based on one of the earlier commits in the 
base PR for TCL.
   I guess we will have to make the method 
[ensure_ti](https://github.com/apache/airflow/blob/main/airflow/utils/log/file_task_handler.py#L135)
 public and re-use here or something like that? @dstandish 



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