pierrejeambrun commented on code in PR #69873:
URL: https://github.com/apache/airflow/pull/69873#discussion_r3631027647
##########
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:
Maybe I got confused, my point is we have the same problem for
`patch_task_instance` endpoint I believe.
The `_patch_task_instance_state` call is before we mutate the 'note',
therefore the listener inside will see the old note.
--
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]