o-nikolas commented on code in PR #45631:
URL: https://github.com/apache/airflow/pull/45631#discussion_r1917422145


##########
airflow/utils/log/file_task_handler.py:
##########
@@ -179,6 +179,8 @@ class FileTaskHandler(logging.Handler):
     inherits_from_empty_operator_log_message = (
         "Operator inherits from empty operator and thus does not have logs"
     )
+    executor_instances: dict[str, BaseExecutor] = {}
+    default_executor_key = "_default_executor"

Review Comment:
   You could just allow `None` as a key type with an or, but this works as well 
:+1:



##########
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:
   Yupp, makes sense, I think that should be safe. Thought it might be worth 
re-running this PR with the full suite of tests.



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