o-nikolas commented on code in PR #44710:
URL: https://github.com/apache/airflow/pull/44710#discussion_r1872460509
##########
airflow/executors/executor_loader.py:
##########
@@ -136,6 +154,39 @@ def _get_executor_names(cls) -> list[ExecutorName]:
return executor_names
+ @classmethod
+ def block_use_of_multi_team(cls):
+ """
+ Raise an exception if the user tries to use multiple team based
executors.
+
+ Before the feature is complete we do not want users to accidentally
configure this.
+ This can be overridden by setting the AIRFLOW__DEV__MULTI_TEAM_MODE
environment
+ variable to "enabled"
+ This check is built into a method so that it can be easily mocked in
unit tests.
+ """
+ team_dev_mode: str | None =
os.environ.get("AIRFLOW__DEV__MULTI_TEAM_MODE")
+ if not team_dev_mode or team_dev_mode != "enabled":
+ raise AirflowConfigException("Configuring multiple team based
executors is not yet supported!")
+
+ @classmethod
+ def _get_team_executor_configs(cls) -> list[tuple[str, list[str]]]:
+ """
+ Return a list of executor configs to be loaded.
+
+ Each tuple contains the team id as the first element and the second
element is the executor config
+ for that team (a list of executor names/modules/aliases).
+ """
+ from airflow.configuration import conf
+
+ team_config = conf.get("core", "multi_team_config_files",
fallback=None)
Review Comment:
Config changes will be coming in a future PR. This will retrieve the
fallback of None, and so the method will return an empty list (thus gating this
new code). If someone does try to use that config setting (and the name may
change) they will hit the exception in `block_use_of_multi_team()`
--
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]