Lee-W commented on code in PR #54114:
URL: https://github.com/apache/airflow/pull/54114#discussion_r2252963576
##########
airflow-core/src/airflow/utils/log/file_task_handler.py:
##########
@@ -862,13 +862,15 @@ def _read_from_local(
def _read_from_logs_server(
self,
- ti: TaskInstance,
+ ti: TaskInstance | TaskInstanceHistory,
worker_log_rel_path: str,
) -> LogResponse:
sources: LogSourceInfo = []
log_streams: list[RawLogStream] = []
try:
- log_type = LogType.TRIGGER if ti.triggerer_job else LogType.WORKER
+ log_type = (
+ LogType.TRIGGER if hasattr(ti, "triggerer_job") and
ti.triggerer_job else LogType.WORKER
+ )
Review Comment:
```suggestion
log_type = (
LogType.TRIGGER if getattr(ti, "triggerer_job", False) else
LogType.WORKER
)
```
--
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]