Coverage for /home/airflow/.local/lib/python3.12/site-packages/airflow/api_fastapi/core_api/datamodels/ui/partitioned_dag_runs.py: 100%

40 statements  

« 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 

18 

19from airflow.api_fastapi.core_api.base import BaseModel 

20 

21 

22class PartitionedDagRunResponse(BaseModel): 

23 """Single partitioned Dag run item.""" 

24 

25 id: int 

26 partition_key: str 

27 created_at: str | None = None 

28 total_received: int 

29 total_required: int 

30 dag_id: str | None = None 

31 state: str | None = None 

32 created_dag_run_id: str | None = None 

33 

34 

35class PartitionedDagRunCollectionResponse(BaseModel): 

36 """Collection of partitioned Dag runs.""" 

37 

38 partitioned_dag_runs: list[PartitionedDagRunResponse] 

39 total: int 

40 asset_expressions: dict[str, dict | None] | None = None 

41 

42 

43class PartitionedDagRunAssetResponse(BaseModel): 

44 """Asset info within a partitioned Dag run detail.""" 

45 

46 asset_id: int 

47 asset_name: str 

48 asset_uri: str 

49 received: bool 

50 received_count: int 

51 required_count: int 

52 received_keys: list[str] 

53 required_keys: list[str] 

54 is_rollup: bool = False 

55 mapper_error: bool = False 

56 """True when the rollup mapper raised; the asset is not-yet-satisfied and 

57 counts / keys are placeholders. The scheduler holds the Dag run for this 

58 asset — UIs should surface this state rather than treating it as "waiting".""" 

59 asset_inactive: bool = False 

60 """True when the upstream asset has been deactivated (orphaned — no Dag 

61 declares it any more). The scheduler freezes partition evaluation for any 

62 APDR depending on this asset; the UI should surface this state rather 

63 than treating it as "waiting".""" 

64 

65 

66class PartitionedDagRunDetailResponse(BaseModel): 

67 """Detail of a single partitioned Dag run.""" 

68 

69 id: int 

70 dag_id: str 

71 partition_key: str 

72 created_at: str | None = None 

73 updated_at: str | None = None 

74 created_dag_run_id: str | None = None 

75 assets: list[PartitionedDagRunAssetResponse] 

76 total_required: int 

77 total_received: int 

78 asset_expression: dict | None = None