o-nikolas commented on code in PR #60438:
URL: https://github.com/apache/airflow/pull/60438#discussion_r2687388728
##########
airflow-core/src/airflow/executors/executor_loader.py:
##########
@@ -249,6 +249,21 @@ def _get_team_executor_configs(cls, validate_teams: bool =
True) -> list[tuple[s
"'CeleryExecutor;team1=LocalExecutor' instead of
'team1=CeleryExecutor;team2=LocalExecutor')."
)
+ # Validate that global executors come before team executors
+ seen_team_executor = False
+ for team_name, _ in configs:
+ if team_name is not None:
+ seen_team_executor = True
+ elif seen_team_executor:
+ # Found a global executor after we've already seen a team
executor
+ raise AirflowConfigException(
Review Comment:
If it's a global executor we'll not set the boolean and just loop again, and
then as soon as we see the first team executor we'll note that with the boolean
being set to true, and then every loop after that should be team executors
(which also sets to true, but that doesn't really matter, it's a no op
basically). So if one isn't a team executor, after we've seen at least one,
then raise the exception.
Does that make sense?
--
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]