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."""
19
20from __future__ import annotations
21
22from enum import Enum, unique
23
24
25# Fields of an encoded object in serialization.
26@unique
27class Encoding(str, Enum):
28 """Enum of encoding constants."""
29
30 TYPE = "__type"
31 VAR = "__var"
32
33
34# Supported types for encoding. primitives and list are not encoded.
35@unique
36class DagAttributeTypes(str, Enum):
37 """Enum of supported attribute types of DAG."""
38
39 DAG = "dag"
40 ASSET_EVENT_ACCESSORS = "asset_event_accessors"
41 ASSET_EVENT_ACCESSOR = "asset_event_accessor"
42 OP = "operator"
43 DATETIME = "datetime"
44 TIMEDELTA = "timedelta"
45 TIMEZONE = "timezone"
46 RELATIVEDELTA = "relativedelta"
47 BASE_TRIGGER = "base_trigger"
48 AIRFLOW_EXC_SER = "airflow_exc_ser"
49 BASE_EXC_SER = "base_exc_ser"
50 DICT = "dict"
51 SET = "set"
52 TUPLE = "tuple"
53 POD = "k8s.V1Pod"
54 TASK_GROUP = "taskgroup"
55 EDGE_INFO = "edgeinfo"
56 PARAM = "param"
57 XCOM_REF = "xcomref"
58 ASSET = "asset"
59 ASSET_ALIAS = "asset_alias"
60 ASSET_ANY = "asset_any"
61 ASSET_ALL = "asset_all"
62 ASSET_REF = "asset_ref"
63 ASSET_UNIQUE_KEY = "asset_unique_key"
64 ASSET_ALIAS_UNIQUE_KEY = "asset_alias_unique_key"
65 CONNECTION = "connection"
66 TASK_CONTEXT = "task_context"
67 ARG_NOT_SET = "arg_not_set"
68 TASK_CALLBACK_REQUEST = "task_callback_request"
69 DAG_CALLBACK_REQUEST = "dag_callback_request"
70 TASK_INSTANCE_KEY = "task_instance_key"
71 DEADLINE_ALERT = "deadline_alert"