potiuk commented on code in PR #60166:
URL: https://github.com/apache/airflow/pull/60166#discussion_r2667608259
##########
airflow-core/src/airflow/models/asset.py:
##########
@@ -112,12 +112,14 @@ def remove_references_to_deleted_dags(session: Session):
DagScheduleAssetAliasReference,
TaskOutletAssetReference,
]
- for model in models_to_check:
- session.execute(
- delete(model)
-
.where(model.dag_id.in_(select(DagModel.dag_id).where(DagModel.is_stale)))
- .execution_options(synchronize_session="fetch")
- )
+
Review Comment:
I'd add a comment here for posterity (also preventing future us trying to
"optimise" this and make it into single query.
--
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]