Coverage for /pythoncovmergedfiles/medio/medio/src/airflow/build/lib/airflow/serialization/enums.py: 100%

29 statements  

« prev     ^ index     » next       coverage.py v7.2.7, created at 2023-06-07 06:35 +0000

1# 

2# Licensed to the Apache Software Foundation (ASF) under one 

3# or more contributor license agreements. See the NOTICE file 

4# distributed with this work for additional information 

5# regarding copyright ownership. The ASF licenses this file 

6# to you under the Apache License, Version 2.0 (the 

7# "License"); you may not use this file except in compliance 

8# with the License. You may obtain a copy of the License at 

9# 

10# http://www.apache.org/licenses/LICENSE-2.0 

11# 

12# Unless required by applicable law or agreed to in writing, 

13# software distributed under the License is distributed on an 

14# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 

15# KIND, either express or implied. See the License for the 

16# specific language governing permissions and limitations 

17# under the License. 

18"""Enums for DAG serialization.""" 

19from __future__ import annotations 

20 

21from enum import Enum, unique 

22 

23 

24# Fields of an encoded object in serialization. 

25@unique 

26class Encoding(str, Enum): 

27 """Enum of encoding constants.""" 

28 

29 TYPE = "__type" 

30 VAR = "__var" 

31 

32 

33# Supported types for encoding. primitives and list are not encoded. 

34@unique 

35class DagAttributeTypes(str, Enum): 

36 """Enum of supported attribute types of DAG.""" 

37 

38 DAG = "dag" 

39 OP = "operator" 

40 DATETIME = "datetime" 

41 TIMEDELTA = "timedelta" 

42 TIMEZONE = "timezone" 

43 RELATIVEDELTA = "relativedelta" 

44 DICT = "dict" 

45 SET = "set" 

46 TUPLE = "tuple" 

47 POD = "k8s.V1Pod" 

48 TASK_GROUP = "taskgroup" 

49 EDGE_INFO = "edgeinfo" 

50 PARAM = "param" 

51 XCOM_REF = "xcomref" 

52 DATASET = "dataset" 

53 SIMPLE_TASK_INSTANCE = "simple_task_instance" 

54 BASE_JOB = "Job" 

55 TASK_INSTANCE = "task_instance" 

56 DAG_RUN = "dag_run" 

57 DATA_SET = "data_set"