Lee-W commented on code in PR #31241:
URL: https://github.com/apache/airflow/pull/31241#discussion_r1263538044
##########
airflow/utils/log/file_task_handler.py:
##########
@@ -218,9 +242,12 @@ def close(self):
if self.handler:
self.handler.close()
- def _render_filename(self, ti: TaskInstance, try_number: int) -> str:
+ def _render_filename(self, ti: TaskInstance | TaskInstanceKey, try_number:
int) -> str:
"""Returns the worker log filename."""
+ from airflow.models.taskinstance import TaskInstance
+
with create_session() as session:
+ ti = TaskInstance.from_ti(ti, session=session)
dag_run = ti.get_dagrun(session=session)
Review Comment:
`USE_PER_RUN_LOG_ID` is not used here, and the case that `USE_PER_RUN_LOG_ID
== False` is when users use airflow < 2.3.3. As I think we don't want to roll
back the code to 2.3.3, I'm confused about what you mean by `USE_PER_RUN_LOG_ID
is false` here.
--
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]