dgvj-work commented on code in PR #71459:
URL: https://github.com/apache/airflow/pull/71459#discussion_r4420466725
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_run.py:
##########
@@ -247,6 +238,7 @@ def patch_dag_run(
if not final_dag_run:
raise HTTPException(status.HTTP_404_NOT_FOUND, "Dag run not found
after update")
+ attach_dag_versions_to_runs([final_dag_run], session=session)
Review Comment:
Moved the DISTINCT lookup into `DagRun.fetch_dag_versions_for_runs` and the
`dag_versions` property fallback, so session-attached runs no longer walk
`task_instances` / `historical_task_instances`. Removed the per-route
`attach_dag_versions_to_runs` calls from GET and PATCH; `clear_dag_run`,
`clear_dag_runs`, and `trigger_dag_run` now have tests asserting serialization
leaves both collections unloaded.
Rebased onto the attempt-archiving change (TIH is gone; archived attempts
are `task_instance` rows with `working_set IS NULL`). The query sets
`include_all_attempts=True` — without that, a full `run_on_latest_version`
clear would hide the older version because it only exists on archived attempts.
--
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]