Lee-W commented on code in PR #63546:
URL: https://github.com/apache/airflow/pull/63546#discussion_r3014729215
##########
airflow/models/dag.py:
##########
@@ -4094,13 +4099,33 @@ def dag_ready(dag_id: str, cond: BaseDataset, statuses:
dict) -> bool | None:
ser_dags = session.scalars(
select(SerializedDagModel).where(SerializedDagModel.dag_id.in_(dag_statuses.keys()))
).all()
+ ser_dag_ids = {s.dag_id for s in ser_dags}
+ missing_from_serialized = set(by_dag.keys()) - ser_dag_ids
+ if missing_from_serialized:
+ log.debug(
+ "DAGs in DDRQ but missing SerializedDagModel "
+ "(skipping — condition cannot be evaluated): %s",
+ sorted(missing_from_serialized),
+ )
+ for dag_id in missing_from_serialized:
+ del by_dag[dag_id]
+ del dag_statuses[dag_id]
Review Comment:
```suggestion
missing_from_serialized = set(by_dag.keys()) - ser_dag_ids
if missing_from_serialized:
log.debug(
"Dags have queued dataset events (DDRQs), but are not found
in the serialized_dag table."
" — skipping Dag run creation: %s",
sorted(missing_from_serialized),
)
for dag_id in missing_from_serialized:
del by_dag[dag_id]
del dag_statuses[dag_id]
```
--
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]