jason810496 commented on code in PR #45631:
URL: https://github.com/apache/airflow/pull/45631#discussion_r1917406045
##########
airflow/utils/log/file_task_handler.py:
##########
@@ -313,10 +313,18 @@ def _render_filename(self, ti: TaskInstance, try_number:
int, session=NEW_SESSIO
def _read_grouped_logs(self):
return False
- @cached_property
- def _executor_get_task_log(self) -> Callable[[TaskInstance, int],
tuple[list[str], list[str]]]:
- """This cached property avoids loading executor repeatedly."""
- executor = ExecutorLoader.get_default_executor()
+ def _get_executor_get_task_log(
Review Comment:
That is a great point!
I refactored by caching the necessary executors, but made some adjustments
on the `ExecutorLoader` side. Specifically, `_get_executor_names` now needs to
be called before using `load_executor`, ensuring that only the `ExecutorName`
is loaded without constructing executor instances.
##########
tests/utils/test_log_handlers.py:
##########
@@ -203,6 +203,66 @@ def task_callable(ti):
# Remove the generated tmp log file.
os.remove(log_filename)
+ @pytest.mark.parametrize(
+ "executor_name",
+ [
Review Comment:
Sure, just added the test case.
--
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]