o-nikolas commented on code in PR #55973: URL: https://github.com/apache/airflow/pull/55973#discussion_r2376671818
########## airflow-core/src/airflow/models/dagbag.py: ########## @@ -147,12 +147,44 @@ 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[dag.bundle_name] + # TODO[multi-team] Raise exceptions below instead of logging once we have a multi-team feature flag configuration + 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 + ) + except Exception as e: + log.debug( Review Comment: I will likely switch this to exception once we have the multi-team flag from your PR @vincbeck I think that will be a great compromise! -- 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]
