Skip to content

Commit a9827cd

Browse files
roshanprabudabla
authored andcommitted
Fix executor validation error referencing non-existent [core] executors (apache#71336)
`_validate_executor_fields` raised UnknownExecutorException telling users to check their "[core] executors configuration" when a task's executor isn't available. That config key doesn't exist -- Airflow has a single [core] executor key (conf.get_mandatory_value("core", "executor")), which accepts a comma-separated list to configure multiple executors. The plural "executors" only ever appears in this error text, sending users looking for a setting that isn't there. Fixes both branches of the message (with and without a team name).
1 parent 79dac3c commit a9827cd

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

airflow-core/src/airflow/dag_processing/dagbag.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,12 @@ def _validate_executor_fields(dag: DAG, bundle_name: str | None = None) -> None:
151151
f"Task '{task.task_id}' specifies executor '{task.executor}', which is not available "
152152
f"for team '{dag_team_name}' (the team associated with DAG '{dag.dag_id}') or as a global executor. "
153153
f"Make sure '{task.executor}' is configured for team '{dag_team_name}' or globally in your "
154-
"[core] executors configuration, or update the task's executor to use one of the "
154+
"[core] executor configuration, or update the task's executor to use one of the "
155155
f"configured executors for team '{dag_team_name}' or available global executors."
156156
)
157157
raise UnknownExecutorException(
158158
f"Task '{task.task_id}' specifies executor '{task.executor}', which is not available. "
159-
"Make sure it is listed in your [core] executors configuration, or update the task's "
159+
"Make sure it is listed in your [core] executor configuration, or update the task's "
160160
"executor to use one of the configured executors."
161161
)
162162

airflow-core/tests/unit/dag_processing/test_dagbag.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def test_executor_validation_failure_with_team(self, mock_lookup, mock_manager_c
185185
"Task 'task1' specifies executor 'invalid.executor', which is not available "
186186
"for team 'test_team' (the team associated with DAG 'test-dag') or as a global executor. "
187187
"Make sure 'invalid.executor' is configured for team 'test_team' or globally in your "
188-
"[core] executors configuration, or update the task's executor to use one of the "
188+
"[core] executor configuration, or update the task's executor to use one of the "
189189
"configured executors for team 'test_team' or available global executors."
190190
),
191191
):
@@ -204,7 +204,7 @@ def test_executor_validation_failure_no_team(self, mock_lookup):
204204
UnknownExecutorException,
205205
match=re.escape(
206206
"Task 'task1' specifies executor 'invalid.executor', which is not available. "
207-
"Make sure it is listed in your [core] executors configuration, or update the task's "
207+
"Make sure it is listed in your [core] executor configuration, or update the task's "
208208
"executor to use one of the configured executors."
209209
),
210210
):
@@ -258,7 +258,7 @@ def test_global_executor_fallback_failure(self, mock_lookup, mock_manager_class)
258258
"Task 'task1' specifies executor 'unknown.executor', which is not available "
259259
"for team 'test_team' (the team associated with DAG 'test-dag') or as a global executor. "
260260
"Make sure 'unknown.executor' is configured for team 'test_team' or globally in your "
261-
"[core] executors configuration, or update the task's executor to use one of the "
261+
"[core] executor configuration, or update the task's executor to use one of the "
262262
"configured executors for team 'test_team' or available global executors."
263263
),
264264
):
@@ -330,7 +330,7 @@ def test_validate_executor_field_executor_not_configured():
330330
UnknownExecutorException,
331331
match=re.escape(
332332
"Task 't1' specifies executor 'test.custom.executor', which is not available. "
333-
"Make sure it is listed in your [core] executors configuration, or update the task's "
333+
"Make sure it is listed in your [core] executor configuration, or update the task's "
334334
"executor to use one of the configured executors."
335335
),
336336
):

0 commit comments

Comments
 (0)