vincbeck commented on code in PR #55973:
URL: https://github.com/apache/airflow/pull/55973#discussion_r2372932638


##########
airflow-core/src/airflow/models/dagbag.py:
##########
@@ -147,12 +147,47 @@ def handle_timeout(signum, frame):
 
 
 def _validate_executor_fields(dag: DAG) -> None:
+    """Validate that executors specified in tasks are available and owned by 
the same team as the dag bundle."""
+    import logging
+
+    log = logging.getLogger(__name__)
+    dag_team_name = None
+
+    # Get team name from bundle configuration if available
+    if hasattr(dag, "bundle_name") and dag.bundle_name:
+        try:
+            from airflow.dag_processing.bundles.manager import 
DagBundlesManager
+
+            bundle_manager = DagBundlesManager()
+            bundle_config = bundle_manager._bundle_config.get(dag.bundle_name)
+            # TODO[multi-team] Raise exceptions below instead of logging once 
we have a multi-team feature flag configuration
+            if bundle_config:
+                dag_team_name = bundle_config.team_name
+                log.debug(
+                    "Found team '%s' for DAG '%s' via bundle '%s'", 
dag_team_name, dag.dag_id, dag.bundle_name
+                )
+            else:
+                log.debug("Bundle '%s' not found in configuration for DAG 
'%s'", dag.bundle_name, dag.dag_id)

Review Comment:
   This branch should not happen right? Or if so, we should raise an exception. 
Maybe a method in `DagBundlesManager` like `get_config` which returns the 
config of a dag bundle given its name, otherwise raise an error



-- 
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]

Reply via email to