ephraimbuddy commented on code in PR #61550:
URL: https://github.com/apache/airflow/pull/61550#discussion_r2799205554


##########
airflow-core/src/airflow/serialization/definitions/dag.py:
##########
@@ -1111,14 +1113,24 @@ def _create_orm_dagrun(
     triggered_by: DagRunTriggeredByType,
     triggering_user_name: str | None = None,
     partition_key: str | None = None,
+    bundle_version: str | None = None,
     session: Session = NEW_SESSION,
 ) -> DagRun:
-    bundle_version = None
+    resolved_bundle_version: str | None = None
     if not dag.disable_bundle_versioning:
-        bundle_version = session.scalar(
-            select(DagModel.bundle_version).where(DagModel.dag_id == 
dag.dag_id),
-        )
-    dag_version = DagVersion.get_latest_version(dag.dag_id, session=session)
+        if bundle_version is not None:
+            resolved_bundle_version = bundle_version
+            dag_version = DagVersion.get_latest_version(
+                dag.dag_id, bundle_version=resolved_bundle_version, 
session=session

Review Comment:
   We need to verify that changing the bundle of a dag also updates the dag 
version table or if it only updates on DagModel table



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