o-nikolas commented on code in PR #55736:
URL: https://github.com/apache/airflow/pull/55736#discussion_r2356022863


##########
airflow-core/src/airflow/dag_processing/bundles/manager.py:
##########
@@ -214,15 +238,34 @@ def _extract_and_sign_template(bundle_name: str) -> 
tuple[str | None, dict]:
                     self.log.debug("Updated template parameters for bundle 
%s", name)
             else:
                 new_template, new_params = _extract_and_sign_template(name)
-                new_bundle = DagBundleModel(name=name)
-                new_bundle.signed_url_template = new_template
-                new_bundle.template_params = new_params
+                bundle = DagBundleModel(name=name)
+                bundle.signed_url_template = new_template
+                bundle.template_params = new_params
 
-                session.add(new_bundle)
+                session.add(bundle)
                 self.log.info("Added new DAG bundle %s to the database", name)
 
+            if team and bundle_to_team.get(name) != config.team_name:
+                # Change of team. It can be associating a team to a dag bundle 
that did not have one or
+                # swapping a team for another
+                bundle.teams = [team]
+                if bundle_to_team.get(name):
+                    self.log.warning(

Review Comment:
   Hmm, okay, I suppose that's fine. I do agree the DB impact is small. If we 
ever switch to a more sane DB schema for Teams though, it could become a lot 
more costly :grimacing: 



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