xBis7 commented on code in PR #43941:
URL: https://github.com/apache/airflow/pull/43941#discussion_r1890357027
##########
airflow/models/taskinstance.py:
##########
@@ -992,7 +1004,11 @@ def get_triggering_events() -> dict[str, list[AssetEvent
| AssetEventPydantic]]:
# Re-attach it if we get called.
nonlocal dag_run
if dag_run not in session:
- dag_run = session.merge(dag_run, load=False)
+ # In case, refresh_from_db has also included the dag_run,
+ # the object will be considered dirty by the session.
+ # Trying to merge the dirty dag_run with load=False, will result
to an SQLAlchemy error.
Review Comment:
After finishing with all the changes, now I can see the error on the PR CI
https://github.com/apache/airflow/actions/runs/12394228248/job/34597663248?pr=43941#step:7:5611
```
sqlalchemy.exc.InvalidRequestError: merge() with load=False option
does not support objects marked as 'dirty'.
flush() all changes on mapped instances before merging with load=False.
```
--
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]