jason810496 commented on code in PR #60105:
URL: https://github.com/apache/airflow/pull/60105#discussion_r2711309269
##########
airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/dags.py:
##########
@@ -23,11 +23,18 @@
from airflow.api_fastapi.core_api.datamodels.ui.dag_runs import
DAGRunLightResponse
+class LatestRunStats(BaseModel):
+ """Stats for the latest DAG run."""
+
+ task_instance_counts: dict[str, int]
+
+
class DAGWithLatestDagRunsResponse(DAGResponse):
"""DAG with latest dag runs response serializer."""
asset_expression: dict | None
latest_dag_runs: list[DAGRunLightResponse]
+ latest_run_stats: LatestRunStats | None = None
Review Comment:
Apologies for the earlier suggestion. I found that annotating the field as
`dict[TaskInstanceState, int]` should be sufficient. We don't need to introduce
an additional data model.
```suggestion
latest_run_stats: dict[TaskInstanceState, int] | None = None
```
--
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]