This is an automated email from the ASF dual-hosted git repository.

gopidesu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new fac3cca9fd8 Avoid log warning team removal for bundles without a team 
(#63756)
fac3cca9fd8 is described below

commit fac3cca9fd846ae16d91b99fedddae4cf95d08aa
Author: GPK <[email protected]>
AuthorDate: Mon Mar 16 22:46:11 2026 +0000

    Avoid log warning team removal for bundles without a team (#63756)
---
 .../src/airflow/dag_processing/bundles/manager.py      |  4 +++-
 .../dag_processing/bundles/test_dag_bundle_manager.py  | 18 ++++++++++++++++++
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/airflow-core/src/airflow/dag_processing/bundles/manager.py 
b/airflow-core/src/airflow/dag_processing/bundles/manager.py
index d13fb027e62..f2f66cd7d2a 100644
--- a/airflow-core/src/airflow/dag_processing/bundles/manager.py
+++ b/airflow-core/src/airflow/dag_processing/bundles/manager.py
@@ -276,7 +276,9 @@ class DagBundlesManager(LoggingMixin):
                         name,
                         team.name,
                     )
-            elif not team and name in bundle_to_team:
+            elif not team and bundle_to_team.get(name) is not None:
+                # Only remove ownership if a team was previously associated; 
stored bundles with
+                # no team already map to None in bundle_to_team.
                 # Remove team association
                 self.log.warning(
                     "Removing ownership of team '%s' from Dag bundle '%s'", 
bundle_to_team[name], name
diff --git 
a/airflow-core/tests/unit/dag_processing/bundles/test_dag_bundle_manager.py 
b/airflow-core/tests/unit/dag_processing/bundles/test_dag_bundle_manager.py
index 74a89d54823..2c00e8aa259 100644
--- a/airflow-core/tests/unit/dag_processing/bundles/test_dag_bundle_manager.py
+++ b/airflow-core/tests/unit/dag_processing/bundles/test_dag_bundle_manager.py
@@ -199,6 +199,24 @@ def test_sync_bundles_to_db(clear_db, session):
     ]
 
 
[email protected]_test
+@conf_vars({("core", "LOAD_EXAMPLES"): "False"})
+def test_sync_bundles_to_db_does_not_log_removing_none_team(clear_db, caplog):
+    with patch.dict(
+        os.environ, {"AIRFLOW__DAG_PROCESSOR__DAG_BUNDLE_CONFIG_LIST": 
json.dumps(BASIC_BUNDLE_CONFIG)}
+    ):
+        manager = DagBundlesManager()
+        manager.sync_bundles_to_db()
+
+        caplog.clear()
+        caplog.set_level("WARNING")
+
+        manager = DagBundlesManager()
+        manager.sync_bundles_to_db()
+
+    assert "Removing ownership of team 'None'" not in caplog.text
+
+
 @conf_vars({("dag_processor", "dag_bundle_config_list"): 
json.dumps(BASIC_BUNDLE_CONFIG)})
 @pytest.mark.parametrize("version", [None, "hello"])
 def test_view_url(version):

Reply via email to