pierrejeambrun commented on code in PR #69873:
URL: https://github.com/apache/airflow/pull/69873#discussion_r3585631321


##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_run.py:
##########
@@ -222,7 +222,9 @@ def patch_dag_run(
 
     data = patch_body.model_dump(include=fields_to_update, by_alias=True)
 
-    for attr_name, attr_value_raw in data.items():
+    # Sort keys so that the "note" update happens before "state" update, so 
that the listeners called inside
+    # `patch_dag_run_state()` already receive updated DagRun object with note.
+    for attr_name, attr_value_raw in sorted(data.items()):

Review Comment:
   +1 for this, we might have a similar problem on the Task Instance endpoint 
as well.



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