dstandish commented on code in PR #42913:
URL: https://github.com/apache/airflow/pull/42913#discussion_r1819800172
##########
airflow/models/dag.py:
##########
@@ -3093,9 +3103,9 @@ def dag_ready(dag_id: str, cond: BaseAsset, statuses:
dict) -> bool | None:
dag_statuses = {}
for dag_id, records in by_dag.items():
dag_statuses[dag_id] = {x.asset.uri: True for x in records}
- ser_dags = session.scalars(
-
select(SerializedDagModel).where(SerializedDagModel.dag_id.in_(dag_statuses.keys()))
- ).all()
+ dag_versions =
DagVersion.get_latest_dag_versions(list(dag_statuses.keys()), session=session)
+ ser_dags = [x.serialized_dag for x in dag_versions if dag_versions]
Review Comment:
if you make dag_versions empty list when there are none, then you don't need
this if
--
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]