jscheffl commented on code in PR #61798:
URL: https://github.com/apache/airflow/pull/61798#discussion_r2869561101
##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/template_rendering.py:
##########
@@ -32,9 +32,27 @@
from airflow.models.taskinstance import TaskInstance
+def _get_executor_conf(dag_id: str):
+ """Build a team-aware ExecutorConf for the given dag_id, if multi-team is
available."""
+ try:
+ from airflow.configuration import conf
+ from airflow.executors.base_executor import ExecutorConf
+ from airflow.models.dag import DagModel
+
+ if not conf.getboolean("core", "multi_team", fallback=False):
+ return None
+ team_name = DagModel.get_team_name(dag_id)
+ if team_name:
+ return ExecutorConf(team_name=team_name)
+ except Exception:
Review Comment:
Any option to make a specific and not a broad exception?
--
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]