uranusjr commented on code in PR #33268:
URL: https://github.com/apache/airflow/pull/33268#discussion_r1289660793
##########
airflow/utils/log/file_task_handler.py:
##########
@@ -492,11 +492,11 @@ def _init_file(self, ti):
def _read_from_local(worker_log_path: Path) -> tuple[list[str], list[str]]:
messages = []
logs = []
- files = list(worker_log_path.parent.glob(worker_log_path.name + "*"))
+ files = sorted(worker_log_path.parent.glob(worker_log_path.name + "*"))
if files:
- messages.extend(["Found local files:", *[f" * {x}" for x in
sorted(files)]])
- for file in sorted(files):
- logs.append(Path(file).read_text())
+ messages.append("Found local files:")
+ messages.extend(f" * {x}" for x in files)
+ logs = [Path(file).read_text() for file in files]
Review Comment:
```suggestion
logs = [file.read_text() for file in files]
```
I believe each entry in `files` (yielded by `Path.glob()`) is already a Path?
--
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]