uranusjr commented on code in PR #64109:
URL: https://github.com/apache/airflow/pull/64109#discussion_r3744847758
##########
airflow-core/src/airflow/models/dagrun.py:
##########
@@ -827,37 +844,39 @@ def get_queued_dag_runs_to_set_running(cls, session:
Session) -> ScalarResult[Da
),
isouter=True,
)
- .join(Backfill, isouter=True)
+ .subquery()
+ )
+
+ query = (
+ select(cls)
.join(
- running_drs,
+ available_dagruns_rn,
and_(
- running_drs.c.dag_id == DagRun.dag_id,
- coalesce(running_drs.c.backfill_id, text("-1"))
- == coalesce(DagRun.backfill_id, text("-1")),
+ available_dagruns_rn.c.id == DagRun.id,
+ available_dagruns_rn.c.dag_id == DagRun.dag_id,
Review Comment:
The `id` join already covers everything (it’s the pk), so the `dag_id` part
seems redundant.
--
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]