Coverage for /home/airflow/.local/lib/python3.12/site-packages/airflow/api_fastapi/core_api/datamodels/ui/dashboard.py: 100%
32 statements
« prev ^ index » next coverage.py v7.15.2, created at 2026-10-07 14:22 +0000
« prev ^ index » next coverage.py v7.15.2, created at 2026-10-07 14:22 +0000
1# Licensed to the Apache Software Foundation (ASF) under one
2# or more contributor license agreements. See the NOTICE file
3# distributed with this work for additional information
4# regarding copyright ownership. The ASF licenses this file
5# to you under the Apache License, Version 2.0 (the
6# "License"); you may not use this file except in compliance
7# with the License. You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing,
12# software distributed under the License is distributed on an
13# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14# KIND, either express or implied. See the License for the
15# specific language governing permissions and limitations
16# under the License.
17from __future__ import annotations
19from airflow.api_fastapi.core_api.base import BaseModel
22class DAGRunStates(BaseModel):
23 """DAG Run States for responses."""
25 queued: int
26 running: int
27 success: int
28 failed: int
31class TaskInstanceStateCount(BaseModel):
32 """TaskInstance serializer for responses."""
34 no_status: int
35 removed: int
36 scheduled: int
37 queued: int
38 running: int
39 success: int
40 restarting: int
41 failed: int
42 up_for_retry: int
43 up_for_reschedule: int
44 upstream_failed: int
45 skipped: int
46 deferred: int
47 awaiting_input: int
50class HistoricalMetricDataResponse(BaseModel):
51 """Historical Metric Data serializer for responses."""
53 dag_run_states: DAGRunStates
54 task_instance_states: TaskInstanceStateCount
55 # True when the counts above are floors on the real values rather than exact figures.
56 dag_run_counts_are_lower_bounds: bool = False
57 task_instance_counts_are_lower_bounds: bool = False
60class DashboardDagStatsResponse(BaseModel):
61 """Dashboard DAG Stats serializer for responses."""
63 active_dag_count: int
64 failed_dag_count: int
65 running_dag_count: int
66 queued_dag_count: int