Coverage for /pythoncovmergedfiles/medio/medio/src/airflow/build/lib/airflow/serialization/pydantic/dag_run.py: 100%
25 statements
« prev ^ index » next coverage.py v7.2.7, created at 2023-06-07 06:35 +0000
« prev ^ index » next coverage.py v7.2.7, created at 2023-06-07 06:35 +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.
18from datetime import datetime
19from typing import List, Optional
21from pendulum import DateTime
22from pydantic import BaseModel as BaseModelPydantic
24from airflow.serialization.pydantic.dataset import DatasetEventPydantic
27class DagRunPydantic(BaseModelPydantic):
28 """Serializable representation of the DagRun ORM SqlAlchemyModel used by internal API."""
30 id: int
31 dag_id: str
32 queued_at: Optional[datetime]
33 execution_date: DateTime
34 start_date: Optional[datetime]
35 end_date: Optional[datetime]
36 state: str
37 run_id: str
38 creating_job_id: Optional[int]
39 external_trigger: bool
40 run_type: str
41 data_interval_start: Optional[datetime]
42 data_interval_end: Optional[datetime]
43 last_scheduling_decision: Optional[datetime]
44 dag_hash: Optional[str]
45 updated_at: datetime
46 consumed_dataset_events: List[DatasetEventPydantic]
48 class Config:
49 """Make sure it deals automatically with SQLAlchemy ORM classes."""
51 orm_mode = True