vincbeck commented on code in PR #40205:
URL: https://github.com/apache/airflow/pull/40205#discussion_r1639927405
##########
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:
Yes I thought about but the reason why I decided to go with config is, most
of executors need config associated to them. So you end up specifying an
executor through a parameter and the rest of the config through env variables
(or config in general). That's why I came up with this approach.
But as a second thought, it might make sense to specify the executor through
parameter and since the config related to the executor is optional and
depending of the executor, config if the way to go for that config. I'll go
with this approach
--
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]