uranusjr commented on code in PR #40205:
URL: https://github.com/apache/airflow/pull/40205#discussion_r1637633340
##########
airflow/models/dag.py:
##########
@@ -2952,6 +2952,21 @@ def add_logger_if_needed(ti: TaskInstance):
# Instead of starting a scheduler, we run the minimal loop
possible to check
# for task readiness and dependency management. This is notably
faster
# than creating a BackfillJob and allows us to surface logs to the
user
+
+ from airflow.executors.local_executor import LocalExecutor
+
+ # Fetch the executor from config
+ # ``Dag.test()`` works in two different modes depending on the
executor:
+ # - if the executor is ``LocalExecutor``, runs the task locally
using ``_run_task``
+ # - if the executor is not ``LocalExecutor``, sends the task
instances to the executor with
+ # ``BaseExecutor.queue_task_instance``
Review Comment:
Instead of doing this, maybe the executor classes should have a unified
entry point for `test()` to use? This would allow other executors to “support”
`test()` is needed too.
--
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]