pierrejeambrun commented on code in PR #68657:
URL: https://github.com/apache/airflow/pull/68657#discussion_r3429475465
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/ui/dashboard.py:
##########
@@ -147,26 +137,30 @@ def dag_stats(
.correlate(DagModel)
.scalar_subquery()
)
- latest_runs_subq = (
- select(latest_state.label("state"))
+ dag_counts_query = (
+ select(
+ func.coalesce(func.sum(case((DagModel.is_paused == false(), 1))),
0).label("active"),
+ func.coalesce(func.sum(case((latest_state == DagRunState.FAILED,
1))), 0).label("failed"),
Review Comment:
Semantic asymmetry. running/queued are now "any run in that state", but
failed is still "latest run is failed". So the three counts are no longer
mutually exclusive (a dag with an old running run + a failed latest run lands
in both running and failed which is weird I think.
We could end up with more failed + running dag that there are dags in total
--
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]