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


##########
airflow-core/src/airflow/serialization/definitions/dag.py:
##########
@@ -69,6 +69,21 @@
 
 log = structlog.get_logger(__name__)
 
+# Callbacks are not serialized, so when running an older bundle version we 
copy them
+# from the live dag to the resolved dag so dag-level event hooks still fire 
correctly.
+# Other DAG-level attrs (max_active_runs, catchup, params, …) intentionally 
come from
+# the old serialized version, since the caller asked for that specific 
historical snapshot.
+_DAG_CALLBACK_ATTRS = (

Review Comment:
   Done



##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_run.py:
##########
@@ -615,16 +633,25 @@ def trigger_dag_run(
             triggering_user_name=user.get_name(),
             state=DagRunState.QUEUED,
             partition_key=params["partition_key"],
+            bundle_version=body.bundle_version,
+            dag_version=resolved_dag_version,
             session=session,
         )
+
+        dag_run_note = body.note
+        if dag_run_note:
+            current_user_id = user.get_id()
+            dag_run.note = (dag_run_note, current_user_id)
+        return dag_run
+
     except (ParamValidationError, ValueError) as e:
         raise HTTPException(status.HTTP_400_BAD_REQUEST, str(e)) from e
-
-    dag_run_note = body.note
-    if dag_run_note:
-        current_user_id = user.get_id()
-        dag_run.note = (dag_run_note, current_user_id)
-    return dag_run
+    except AirflowNotFoundException as e:

Review Comment:
   Done



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