File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
airflow-core/src/airflow/models Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 9898
9999 from opentelemetry .sdk .trace import Span
100100 from pydantic import NonNegativeInt
101- from sqlalchemy .orm import Query , Session
101+ from sqlalchemy .engine import ScalarResult
102+ from sqlalchemy .orm import Session
102103 from sqlalchemy .sql .elements import Case , ColumnElement
103104
104105 from airflow .models .dag_version import DagVersion
@@ -572,11 +573,11 @@ def active_runs_of_dags(
572573 )
573574 if exclude_backfill :
574575 query = query .where (cls .run_type != DagRunType .BACKFILL_JOB )
575- return dict ( session .execute (query ). all ())
576+ return { dag_id : count for dag_id , count in session .execute (query )}
576577
577578 @classmethod
578579 @retry_db_transaction
579- def get_running_dag_runs_to_examine (cls , session : Session ) -> Query :
580+ def get_running_dag_runs_to_examine (cls , session : Session ) -> ScalarResult [ DagRun ] :
580581 """
581582 Return the next DagRuns that the scheduler should attempt to schedule.
582583
@@ -615,7 +616,7 @@ def get_running_dag_runs_to_examine(cls, session: Session) -> Query:
615616
616617 @classmethod
617618 @retry_db_transaction
618- def get_queued_dag_runs_to_set_running (cls , session : Session ) -> Query :
619+ def get_queued_dag_runs_to_set_running (cls , session : Session ) -> ScalarResult [ DagRun ] :
619620 """
620621 Return the next queued DagRuns that the scheduler should attempt to schedule.
621622
You can’t perform that action at this time.
0 commit comments