omkar-foss commented on code in PR #43255: URL: https://github.com/apache/airflow/pull/43255#discussion_r1827441756
########## airflow/api_fastapi/common/db/dags.py: ########## @@ -45,3 +45,13 @@ ) .order_by(DagModel.dag_id) ) + +dagruns_select_with_state_count = ( + select( + DagRun.dag_id, + DagRun.state, + func.count(DagRun.state), + ) + .group_by(DagRun.dag_id, DagRun.state) + .order_by(DagRun.dag_id) +) Review Comment: Oh okay, I was wondering if we keep all dag-related resources (dag, dag code, dag stats etc.) under same file since we've few queries. But yes, one file per entity works too. Updated PR, moved query to new file `dag_runs.py` 👍🏽 -- 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org