apache-airflow-providers-common-compat 1.7.4rc1__py3-none-any.whl → 1.8.0rc1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- airflow/providers/common/compat/__init__.py +1 -1
- airflow/providers/common/compat/_compat_utils.py +105 -0
- airflow/providers/common/compat/sdk.py +219 -0
- airflow/providers/common/compat/sqlalchemy/__init__.py +16 -0
- airflow/providers/common/compat/sqlalchemy/orm.py +27 -0
- airflow/providers/common/compat/standard/operators.py +12 -29
- airflow/providers/common/compat/standard/triggers.py +6 -9
- airflow/providers/common/compat/standard/utils.py +13 -9
- {apache_airflow_providers_common_compat-1.7.4rc1.dist-info → apache_airflow_providers_common_compat-1.8.0rc1.dist-info}/METADATA +6 -7
- {apache_airflow_providers_common_compat-1.7.4rc1.dist-info → apache_airflow_providers_common_compat-1.8.0rc1.dist-info}/RECORD +12 -8
- {apache_airflow_providers_common_compat-1.7.4rc1.dist-info → apache_airflow_providers_common_compat-1.8.0rc1.dist-info}/WHEEL +0 -0
- {apache_airflow_providers_common_compat-1.7.4rc1.dist-info → apache_airflow_providers_common_compat-1.8.0rc1.dist-info}/entry_points.txt +0 -0
|
@@ -29,7 +29,7 @@ from airflow import __version__ as airflow_version
|
|
|
29
29
|
|
|
30
30
|
__all__ = ["__version__"]
|
|
31
31
|
|
|
32
|
-
__version__ = "1.
|
|
32
|
+
__version__ = "1.8.0"
|
|
33
33
|
|
|
34
34
|
if packaging.version.parse(packaging.version.parse(airflow_version).base_version) < packaging.version.parse(
|
|
35
35
|
"2.10.0"
|
|
@@ -0,0 +1,105 @@
|
|
|
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.
|
|
17
|
+
|
|
18
|
+
"""
|
|
19
|
+
Reusable utilities for creating compatibility layers with fallback imports.
|
|
20
|
+
|
|
21
|
+
This module provides the core machinery used by sdk.py and standard/* modules
|
|
22
|
+
to handle import fallbacks between Airflow 3.x and 2.x.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
from __future__ import annotations
|
|
26
|
+
|
|
27
|
+
import importlib
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def create_module_getattr(
|
|
31
|
+
import_map: dict[str, str | tuple[str, ...]],
|
|
32
|
+
module_map: dict[str, str | tuple[str, ...]] | None = None,
|
|
33
|
+
rename_map: dict[str, tuple[str, str, str]] | None = None,
|
|
34
|
+
):
|
|
35
|
+
"""
|
|
36
|
+
Create a __getattr__ function for lazy imports with fallback support.
|
|
37
|
+
|
|
38
|
+
:param import_map: Dictionary mapping attribute names to module paths (single or tuple for fallback)
|
|
39
|
+
:param module_map: Dictionary mapping module names to module paths (single or tuple for fallback)
|
|
40
|
+
:param rename_map: Dictionary mapping new names to (new_path, old_path, old_name) tuples
|
|
41
|
+
:return: A __getattr__ function that can be assigned at module level
|
|
42
|
+
"""
|
|
43
|
+
module_map = module_map or {}
|
|
44
|
+
rename_map = rename_map or {}
|
|
45
|
+
|
|
46
|
+
def __getattr__(name: str):
|
|
47
|
+
# Check renamed imports first
|
|
48
|
+
if name in rename_map:
|
|
49
|
+
new_path, old_path, old_name = rename_map[name]
|
|
50
|
+
|
|
51
|
+
rename_error: ImportError | ModuleNotFoundError | AttributeError | None = None
|
|
52
|
+
# Try new path with new name first (Airflow 3.x)
|
|
53
|
+
try:
|
|
54
|
+
module = __import__(new_path, fromlist=[name])
|
|
55
|
+
return getattr(module, name)
|
|
56
|
+
except (ImportError, ModuleNotFoundError, AttributeError) as e:
|
|
57
|
+
rename_error = e
|
|
58
|
+
|
|
59
|
+
# Fall back to old path with old name (Airflow 2.x)
|
|
60
|
+
try:
|
|
61
|
+
module = __import__(old_path, fromlist=[old_name])
|
|
62
|
+
return getattr(module, old_name)
|
|
63
|
+
except (ImportError, ModuleNotFoundError, AttributeError):
|
|
64
|
+
if rename_error:
|
|
65
|
+
raise ImportError(
|
|
66
|
+
f"Could not import {name!r} from {new_path!r} or {old_name!r} from {old_path!r}"
|
|
67
|
+
) from rename_error
|
|
68
|
+
raise
|
|
69
|
+
|
|
70
|
+
# Check module imports
|
|
71
|
+
if name in module_map:
|
|
72
|
+
value = module_map[name]
|
|
73
|
+
paths = value if isinstance(value, tuple) else (value,)
|
|
74
|
+
|
|
75
|
+
module_error: ImportError | ModuleNotFoundError | None = None
|
|
76
|
+
for module_path in paths:
|
|
77
|
+
try:
|
|
78
|
+
return importlib.import_module(module_path)
|
|
79
|
+
except (ImportError, ModuleNotFoundError) as e:
|
|
80
|
+
module_error = e
|
|
81
|
+
continue
|
|
82
|
+
|
|
83
|
+
if module_error:
|
|
84
|
+
raise ImportError(f"Could not import module {name!r} from any of: {paths}") from module_error
|
|
85
|
+
|
|
86
|
+
# Check regular imports
|
|
87
|
+
if name in import_map:
|
|
88
|
+
value = import_map[name]
|
|
89
|
+
paths = value if isinstance(value, tuple) else (value,)
|
|
90
|
+
|
|
91
|
+
attr_error: ImportError | ModuleNotFoundError | AttributeError | None = None
|
|
92
|
+
for module_path in paths:
|
|
93
|
+
try:
|
|
94
|
+
module = __import__(module_path, fromlist=[name])
|
|
95
|
+
return getattr(module, name)
|
|
96
|
+
except (ImportError, ModuleNotFoundError, AttributeError) as e:
|
|
97
|
+
attr_error = e
|
|
98
|
+
continue
|
|
99
|
+
|
|
100
|
+
if attr_error:
|
|
101
|
+
raise ImportError(f"Could not import {name!r} from any of: {paths}") from attr_error
|
|
102
|
+
|
|
103
|
+
raise AttributeError(f"module has no attribute {name!r}")
|
|
104
|
+
|
|
105
|
+
return __getattr__
|
|
@@ -0,0 +1,219 @@
|
|
|
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.
|
|
17
|
+
"""
|
|
18
|
+
Airflow compatibility imports for seamless migration from Airflow 2 to Airflow 3.
|
|
19
|
+
|
|
20
|
+
This module provides lazy imports that automatically try Airflow 3 paths first,
|
|
21
|
+
then fall back to Airflow 2 paths, enabling code to work across both versions.
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
from __future__ import annotations
|
|
25
|
+
|
|
26
|
+
from typing import TYPE_CHECKING
|
|
27
|
+
|
|
28
|
+
if TYPE_CHECKING:
|
|
29
|
+
import airflow.sdk.io as io # noqa: F401
|
|
30
|
+
import airflow.sdk.timezone as timezone # noqa: F401
|
|
31
|
+
from airflow.models.xcom import XCOM_RETURN_KEY as XCOM_RETURN_KEY
|
|
32
|
+
from airflow.sdk import (
|
|
33
|
+
DAG as DAG,
|
|
34
|
+
Asset as Asset,
|
|
35
|
+
AssetAlias as AssetAlias,
|
|
36
|
+
AssetAll as AssetAll,
|
|
37
|
+
AssetAny as AssetAny,
|
|
38
|
+
BaseHook as BaseHook,
|
|
39
|
+
BaseNotifier as BaseNotifier,
|
|
40
|
+
BaseOperator as BaseOperator,
|
|
41
|
+
BaseOperatorLink as BaseOperatorLink,
|
|
42
|
+
BaseSensorOperator as BaseSensorOperator,
|
|
43
|
+
Connection as Connection,
|
|
44
|
+
Context as Context,
|
|
45
|
+
DagRunState as DagRunState,
|
|
46
|
+
EdgeModifier as EdgeModifier,
|
|
47
|
+
Label as Label,
|
|
48
|
+
Metadata as Metadata,
|
|
49
|
+
ObjectStoragePath as ObjectStoragePath,
|
|
50
|
+
Param as Param,
|
|
51
|
+
PokeReturnValue as PokeReturnValue,
|
|
52
|
+
TaskGroup as TaskGroup,
|
|
53
|
+
TaskInstanceState as TaskInstanceState,
|
|
54
|
+
TriggerRule as TriggerRule,
|
|
55
|
+
Variable as Variable,
|
|
56
|
+
WeightRule as WeightRule,
|
|
57
|
+
XComArg as XComArg,
|
|
58
|
+
chain as chain,
|
|
59
|
+
chain_linear as chain_linear,
|
|
60
|
+
cross_downstream as cross_downstream,
|
|
61
|
+
dag as dag,
|
|
62
|
+
get_current_context as get_current_context,
|
|
63
|
+
get_parsing_context as get_parsing_context,
|
|
64
|
+
setup as setup,
|
|
65
|
+
task as task,
|
|
66
|
+
task_group as task_group,
|
|
67
|
+
teardown as teardown,
|
|
68
|
+
)
|
|
69
|
+
from airflow.sdk.bases.decorator import (
|
|
70
|
+
DecoratedMappedOperator as DecoratedMappedOperator,
|
|
71
|
+
DecoratedOperator as DecoratedOperator,
|
|
72
|
+
TaskDecorator as TaskDecorator,
|
|
73
|
+
get_unique_task_id as get_unique_task_id,
|
|
74
|
+
task_decorator_factory as task_decorator_factory,
|
|
75
|
+
)
|
|
76
|
+
from airflow.sdk.bases.sensor import poke_mode_only as poke_mode_only
|
|
77
|
+
from airflow.sdk.definitions.context import context_merge as context_merge
|
|
78
|
+
from airflow.sdk.definitions.mappedoperator import MappedOperator as MappedOperator
|
|
79
|
+
from airflow.sdk.definitions.template import literal as literal
|
|
80
|
+
from airflow.sdk.execution_time.context import (
|
|
81
|
+
AIRFLOW_VAR_NAME_FORMAT_MAPPING as AIRFLOW_VAR_NAME_FORMAT_MAPPING,
|
|
82
|
+
context_to_airflow_vars as context_to_airflow_vars,
|
|
83
|
+
)
|
|
84
|
+
from airflow.sdk.execution_time.timeout import timeout as timeout
|
|
85
|
+
from airflow.sdk.execution_time.xcom import XCom as XCom
|
|
86
|
+
|
|
87
|
+
from airflow.providers.common.compat._compat_utils import create_module_getattr
|
|
88
|
+
|
|
89
|
+
# Rename map for classes that changed names between Airflow 2.x and 3.x
|
|
90
|
+
# Format: new_name -> (new_path, old_path, old_name)
|
|
91
|
+
_RENAME_MAP: dict[str, tuple[str, str, str]] = {
|
|
92
|
+
# Assets: Dataset -> Asset rename in Airflow 3.0
|
|
93
|
+
"Asset": ("airflow.sdk", "airflow.datasets", "Dataset"),
|
|
94
|
+
"AssetAlias": ("airflow.sdk", "airflow.datasets", "DatasetAlias"),
|
|
95
|
+
"AssetAll": ("airflow.sdk", "airflow.datasets", "DatasetAll"),
|
|
96
|
+
"AssetAny": ("airflow.sdk", "airflow.datasets", "DatasetAny"),
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
# Import map for classes/functions/constants
|
|
100
|
+
# Format: class_name -> module_path(s)
|
|
101
|
+
# - str: single module path (no fallback)
|
|
102
|
+
# - tuple[str, ...]: multiple module paths (try in order, newest first)
|
|
103
|
+
_IMPORT_MAP: dict[str, str | tuple[str, ...]] = {
|
|
104
|
+
# ============================================================================
|
|
105
|
+
# Hooks
|
|
106
|
+
# ============================================================================
|
|
107
|
+
"BaseHook": ("airflow.sdk", "airflow.hooks.base"),
|
|
108
|
+
# ============================================================================
|
|
109
|
+
# Sensors
|
|
110
|
+
# ============================================================================
|
|
111
|
+
"BaseSensorOperator": ("airflow.sdk", "airflow.sensors.base"),
|
|
112
|
+
"PokeReturnValue": ("airflow.sdk", "airflow.sensors.base"),
|
|
113
|
+
"poke_mode_only": ("airflow.sdk.bases.sensor", "airflow.sensors.base"),
|
|
114
|
+
# ============================================================================
|
|
115
|
+
# Operators
|
|
116
|
+
# ============================================================================
|
|
117
|
+
"BaseOperator": ("airflow.sdk", "airflow.models.baseoperator"),
|
|
118
|
+
# ============================================================================
|
|
119
|
+
# Decorators
|
|
120
|
+
# ============================================================================
|
|
121
|
+
"task": ("airflow.sdk", "airflow.decorators"),
|
|
122
|
+
"dag": ("airflow.sdk", "airflow.decorators"),
|
|
123
|
+
"task_group": ("airflow.sdk", "airflow.decorators"),
|
|
124
|
+
"setup": ("airflow.sdk", "airflow.decorators"),
|
|
125
|
+
"teardown": ("airflow.sdk", "airflow.decorators"),
|
|
126
|
+
"TaskDecorator": ("airflow.sdk.bases.decorator", "airflow.decorators"),
|
|
127
|
+
"task_decorator_factory": ("airflow.sdk.bases.decorator", "airflow.decorators.base"),
|
|
128
|
+
"get_unique_task_id": ("airflow.sdk.bases.decorator", "airflow.decorators.base"),
|
|
129
|
+
# ============================================================================
|
|
130
|
+
# Models
|
|
131
|
+
# ============================================================================
|
|
132
|
+
"Connection": ("airflow.sdk", "airflow.models.connection"),
|
|
133
|
+
"Variable": ("airflow.sdk", "airflow.models.variable"),
|
|
134
|
+
"XCom": ("airflow.sdk.execution_time.xcom", "airflow.models.xcom"),
|
|
135
|
+
"DAG": ("airflow.sdk", "airflow.models.dag"),
|
|
136
|
+
"Param": ("airflow.sdk", "airflow.models.param"),
|
|
137
|
+
"XComArg": ("airflow.sdk", "airflow.models.xcom_arg"),
|
|
138
|
+
"DecoratedOperator": ("airflow.sdk.bases.decorator", "airflow.decorators.base"),
|
|
139
|
+
"DecoratedMappedOperator": ("airflow.sdk.bases.decorator", "airflow.decorators.base"),
|
|
140
|
+
"MappedOperator": ("airflow.sdk.definitions.mappedoperator", "airflow.models.mappedoperator"),
|
|
141
|
+
# ============================================================================
|
|
142
|
+
# Assets (Dataset → Asset rename in Airflow 3.0)
|
|
143
|
+
# ============================================================================
|
|
144
|
+
# Note: Asset, AssetAlias, AssetAll, AssetAny are handled by _RENAME_MAP
|
|
145
|
+
# Metadata moved from airflow.datasets.metadata (2.x) to airflow.sdk (3.x)
|
|
146
|
+
"Metadata": ("airflow.sdk", "airflow.datasets.metadata"),
|
|
147
|
+
# ============================================================================
|
|
148
|
+
# Notifiers
|
|
149
|
+
# ============================================================================
|
|
150
|
+
"BaseNotifier": ("airflow.sdk", "airflow.notifications.basenotifier"),
|
|
151
|
+
# ============================================================================
|
|
152
|
+
# Operator Links & Task Groups
|
|
153
|
+
# ============================================================================
|
|
154
|
+
"BaseOperatorLink": ("airflow.sdk", "airflow.models.baseoperatorlink"),
|
|
155
|
+
"TaskGroup": ("airflow.sdk", "airflow.utils.task_group"),
|
|
156
|
+
# ============================================================================
|
|
157
|
+
# Operator Utilities (chain, cross_downstream, etc.)
|
|
158
|
+
# ============================================================================
|
|
159
|
+
"chain": ("airflow.sdk", "airflow.models.baseoperator"),
|
|
160
|
+
"chain_linear": ("airflow.sdk", "airflow.models.baseoperator"),
|
|
161
|
+
"cross_downstream": ("airflow.sdk", "airflow.models.baseoperator"),
|
|
162
|
+
# ============================================================================
|
|
163
|
+
# Edge Modifiers & Labels
|
|
164
|
+
# ============================================================================
|
|
165
|
+
"EdgeModifier": ("airflow.sdk", "airflow.utils.edgemodifier"),
|
|
166
|
+
"Label": ("airflow.sdk", "airflow.utils.edgemodifier"),
|
|
167
|
+
# ============================================================================
|
|
168
|
+
# State Enums
|
|
169
|
+
# ============================================================================
|
|
170
|
+
"DagRunState": ("airflow.sdk", "airflow.utils.state"),
|
|
171
|
+
"TaskInstanceState": ("airflow.sdk", "airflow.utils.state"),
|
|
172
|
+
"TriggerRule": ("airflow.sdk", "airflow.utils.trigger_rule"),
|
|
173
|
+
"WeightRule": ("airflow.sdk", "airflow.utils.weight_rule"),
|
|
174
|
+
# ============================================================================
|
|
175
|
+
# IO & Storage
|
|
176
|
+
# ============================================================================
|
|
177
|
+
"ObjectStoragePath": ("airflow.sdk", "airflow.io.path"),
|
|
178
|
+
# ============================================================================
|
|
179
|
+
# Template Utilities
|
|
180
|
+
# ============================================================================
|
|
181
|
+
"literal": ("airflow.sdk.definitions.template", "airflow.utils.template"),
|
|
182
|
+
# ============================================================================
|
|
183
|
+
# Context & Utilities
|
|
184
|
+
# ============================================================================
|
|
185
|
+
"Context": ("airflow.sdk", "airflow.utils.context"),
|
|
186
|
+
"context_merge": ("airflow.sdk.definitions.context", "airflow.utils.context"),
|
|
187
|
+
"context_to_airflow_vars": ("airflow.sdk.execution_time.context", "airflow.utils.operator_helpers"),
|
|
188
|
+
"AIRFLOW_VAR_NAME_FORMAT_MAPPING": (
|
|
189
|
+
"airflow.sdk.execution_time.context",
|
|
190
|
+
"airflow.utils.operator_helpers",
|
|
191
|
+
),
|
|
192
|
+
"get_current_context": ("airflow.sdk", "airflow.operators.python"),
|
|
193
|
+
"get_parsing_context": ("airflow.sdk", "airflow.utils.dag_parsing_context"),
|
|
194
|
+
# ============================================================================
|
|
195
|
+
# Timeout Utilities
|
|
196
|
+
# ============================================================================
|
|
197
|
+
"timeout": ("airflow.sdk.execution_time.timeout", "airflow.utils.timeout"),
|
|
198
|
+
# ============================================================================
|
|
199
|
+
# XCom & Task Communication
|
|
200
|
+
# ============================================================================
|
|
201
|
+
"XCOM_RETURN_KEY": "airflow.models.xcom",
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
# Module map: module_name -> module_path(s)
|
|
205
|
+
# For entire modules that have been moved (e.g., timezone)
|
|
206
|
+
# Usage: from airflow.providers.common.compat.lazy_compat import timezone
|
|
207
|
+
_MODULE_MAP: dict[str, str | tuple[str, ...]] = {
|
|
208
|
+
"timezone": ("airflow.sdk.timezone", "airflow.utils.timezone"),
|
|
209
|
+
"io": ("airflow.sdk.io", "airflow.io"),
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
# Use the shared utility to create __getattr__
|
|
213
|
+
__getattr__ = create_module_getattr(
|
|
214
|
+
import_map=_IMPORT_MAP,
|
|
215
|
+
module_map=_MODULE_MAP,
|
|
216
|
+
rename_map=_RENAME_MAP,
|
|
217
|
+
)
|
|
218
|
+
|
|
219
|
+
__all__ = list(_RENAME_MAP.keys()) + list(_IMPORT_MAP.keys()) + list(_MODULE_MAP.keys())
|
|
@@ -0,0 +1,16 @@
|
|
|
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.
|
|
@@ -0,0 +1,27 @@
|
|
|
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.
|
|
17
|
+
|
|
18
|
+
from __future__ import annotations
|
|
19
|
+
|
|
20
|
+
try:
|
|
21
|
+
from sqlalchemy.orm import mapped_column
|
|
22
|
+
except ImportError:
|
|
23
|
+
# fallback for SQLAlchemy < 2.0
|
|
24
|
+
def mapped_column(*args, **kwargs):
|
|
25
|
+
from sqlalchemy import Column
|
|
26
|
+
|
|
27
|
+
return Column(*args, **kwargs)
|
|
@@ -17,35 +17,18 @@
|
|
|
17
17
|
|
|
18
18
|
from __future__ import annotations
|
|
19
19
|
|
|
20
|
-
from
|
|
20
|
+
from airflow.providers.common.compat._compat_utils import create_module_getattr
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
from
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
from airflow.providers.standard.operators.python import (
|
|
32
|
-
_SERIALIZERS,
|
|
33
|
-
PythonOperator,
|
|
34
|
-
ShortCircuitOperator,
|
|
35
|
-
get_current_context,
|
|
36
|
-
)
|
|
37
|
-
except ModuleNotFoundError:
|
|
38
|
-
from airflow.operators.python import (
|
|
39
|
-
_SERIALIZERS,
|
|
40
|
-
PythonOperator,
|
|
41
|
-
ShortCircuitOperator,
|
|
42
|
-
)
|
|
22
|
+
_IMPORT_MAP: dict[str, str | tuple[str, ...]] = {
|
|
23
|
+
# Re-export from sdk (which handles Airflow 2.x/3.x fallbacks)
|
|
24
|
+
"BaseOperator": "airflow.providers.common.compat.sdk",
|
|
25
|
+
"get_current_context": "airflow.providers.common.compat.sdk",
|
|
26
|
+
# Standard provider items with direct fallbacks
|
|
27
|
+
"PythonOperator": ("airflow.providers.standard.operators.python", "airflow.operators.python"),
|
|
28
|
+
"ShortCircuitOperator": ("airflow.providers.standard.operators.python", "airflow.operators.python"),
|
|
29
|
+
"_SERIALIZERS": ("airflow.providers.standard.operators.python", "airflow.operators.python"),
|
|
30
|
+
}
|
|
43
31
|
|
|
44
|
-
|
|
45
|
-
from airflow.sdk import get_current_context
|
|
46
|
-
except (ImportError, ModuleNotFoundError):
|
|
47
|
-
from airflow.providers.standard.operators.python import get_current_context
|
|
32
|
+
__getattr__ = create_module_getattr(import_map=_IMPORT_MAP)
|
|
48
33
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
__all__ = ["BaseOperator", "PythonOperator", "_SERIALIZERS", "ShortCircuitOperator", "get_current_context"]
|
|
34
|
+
__all__ = sorted(_IMPORT_MAP.keys())
|
|
@@ -17,15 +17,12 @@
|
|
|
17
17
|
|
|
18
18
|
from __future__ import annotations
|
|
19
19
|
|
|
20
|
-
from
|
|
20
|
+
from airflow.providers.common.compat._compat_utils import create_module_getattr
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
try:
|
|
26
|
-
from airflow.providers.standard.triggers.temporal import TimeDeltaTrigger
|
|
27
|
-
except ModuleNotFoundError:
|
|
28
|
-
from airflow.triggers.temporal import TimeDeltaTrigger
|
|
22
|
+
_IMPORT_MAP: dict[str, str | tuple[str, ...]] = {
|
|
23
|
+
"TimeDeltaTrigger": ("airflow.providers.standard.triggers.temporal", "airflow.triggers.temporal"),
|
|
24
|
+
}
|
|
29
25
|
|
|
26
|
+
__getattr__ = create_module_getattr(import_map=_IMPORT_MAP)
|
|
30
27
|
|
|
31
|
-
__all__ =
|
|
28
|
+
__all__ = sorted(_IMPORT_MAP.keys())
|
|
@@ -17,15 +17,19 @@
|
|
|
17
17
|
|
|
18
18
|
from __future__ import annotations
|
|
19
19
|
|
|
20
|
-
from
|
|
20
|
+
from airflow.providers.common.compat._compat_utils import create_module_getattr
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
_IMPORT_MAP: dict[str, str | tuple[str, ...]] = {
|
|
23
|
+
"write_python_script": (
|
|
24
|
+
"airflow.providers.standard.utils.python_virtualenv",
|
|
25
|
+
"airflow.utils.python_virtualenv",
|
|
26
|
+
),
|
|
27
|
+
"prepare_virtualenv": (
|
|
28
|
+
"airflow.providers.standard.utils.python_virtualenv",
|
|
29
|
+
"airflow.utils.python_virtualenv",
|
|
30
|
+
),
|
|
31
|
+
}
|
|
29
32
|
|
|
33
|
+
__getattr__ = create_module_getattr(import_map=_IMPORT_MAP)
|
|
30
34
|
|
|
31
|
-
__all__ =
|
|
35
|
+
__all__ = sorted(_IMPORT_MAP.keys())
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: apache-airflow-providers-common-compat
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.8.0rc1
|
|
4
4
|
Summary: Provider package apache-airflow-providers-common-compat for Apache Airflow
|
|
5
5
|
Keywords: airflow-provider,common.compat,airflow,integration
|
|
6
6
|
Author-email: Apache Software Foundation <dev@airflow.apache.org>
|
|
@@ -24,8 +24,8 @@ Requires-Dist: apache-airflow>=2.10.0rc1
|
|
|
24
24
|
Requires-Dist: apache-airflow-providers-openlineage ; extra == "openlineage"
|
|
25
25
|
Requires-Dist: apache-airflow-providers-standard ; extra == "standard"
|
|
26
26
|
Project-URL: Bug Tracker, https://github.com/apache/airflow/issues
|
|
27
|
-
Project-URL: Changelog, https://airflow.staged.apache.org/docs/apache-airflow-providers-common-compat/1.
|
|
28
|
-
Project-URL: Documentation, https://airflow.staged.apache.org/docs/apache-airflow-providers-common-compat/1.
|
|
27
|
+
Project-URL: Changelog, https://airflow.staged.apache.org/docs/apache-airflow-providers-common-compat/1.8.0/changelog.html
|
|
28
|
+
Project-URL: Documentation, https://airflow.staged.apache.org/docs/apache-airflow-providers-common-compat/1.8.0
|
|
29
29
|
Project-URL: Mastodon, https://fosstodon.org/@airflow
|
|
30
30
|
Project-URL: Slack Chat, https://s.apache.org/airflow-slack
|
|
31
31
|
Project-URL: Source Code, https://github.com/apache/airflow
|
|
@@ -58,7 +58,7 @@ Provides-Extra: standard
|
|
|
58
58
|
|
|
59
59
|
Package ``apache-airflow-providers-common-compat``
|
|
60
60
|
|
|
61
|
-
Release: ``1.
|
|
61
|
+
Release: ``1.8.0``
|
|
62
62
|
|
|
63
63
|
|
|
64
64
|
Common Compatibility Provider - providing compatibility code for previous Airflow versions
|
|
@@ -71,7 +71,7 @@ This is a provider package for ``common.compat`` provider. All classes for this
|
|
|
71
71
|
are in ``airflow.providers.common.compat`` python package.
|
|
72
72
|
|
|
73
73
|
You can find package information and changelog for the provider
|
|
74
|
-
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-common-compat/1.
|
|
74
|
+
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-common-compat/1.8.0/>`_.
|
|
75
75
|
|
|
76
76
|
Installation
|
|
77
77
|
------------
|
|
@@ -108,7 +108,6 @@ You can install such cross-provider dependencies when installing from PyPI. For
|
|
|
108
108
|
Dependent package Extra
|
|
109
109
|
============================================================================================================== ===============
|
|
110
110
|
`apache-airflow-providers-openlineage <https://airflow.apache.org/docs/apache-airflow-providers-openlineage>`_ ``openlineage``
|
|
111
|
-
`apache-airflow-providers-standard <https://airflow.apache.org/docs/apache-airflow-providers-standard>`_ ``standard``
|
|
112
111
|
============================================================================================================== ===============
|
|
113
112
|
|
|
114
113
|
Optional dependencies
|
|
@@ -122,5 +121,5 @@ Extra Dependencies
|
|
|
122
121
|
=============== ========================================
|
|
123
122
|
|
|
124
123
|
The changelog for the provider package can be found in the
|
|
125
|
-
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-common-compat/1.
|
|
124
|
+
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-common-compat/1.8.0/changelog.html>`_.
|
|
126
125
|
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
airflow/providers/common/compat/LICENSE,sha256=gXPVwptPlW1TJ4HSuG5OMPg-a3h43OGMkZRR1rpwfJA,10850
|
|
2
|
-
airflow/providers/common/compat/__init__.py,sha256=
|
|
2
|
+
airflow/providers/common/compat/__init__.py,sha256=gD_LMyyIrCFT4-3zmNRsHVsfHu8BlvXR80wNURTQWAc,1502
|
|
3
|
+
airflow/providers/common/compat/_compat_utils.py,sha256=MAB8q34kchNo05y5iufKs_82MXe-lLbpwHlfbb1tJGQ,4294
|
|
3
4
|
airflow/providers/common/compat/check.py,sha256=d6at8iFn_c2jbnmvswoMYz1DFUrAbQTVKMCA5PYAOrQ,4347
|
|
4
5
|
airflow/providers/common/compat/get_provider_info.py,sha256=BfscTzSrq5WxqTt4njI9WwvWyvE3JjYYfZEdrSRT6IU,1555
|
|
6
|
+
airflow/providers/common/compat/sdk.py,sha256=EJ7bu4Iuuqu0W1JCCo9k-PD14ZAtz_KiTedmnVCoLUk,11264
|
|
5
7
|
airflow/providers/common/compat/version_compat.py,sha256=4f4HIVNU9aCzHJO2HlKkm0nlr2gpIGmcLI46LeMqpBk,1805
|
|
6
8
|
airflow/providers/common/compat/assets/__init__.py,sha256=P1xX2Nw8LeS3u_Prz-SZL_jtTteHXqDd-0G8hZXD8oU,2079
|
|
7
9
|
airflow/providers/common/compat/lineage/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
|
@@ -17,11 +19,13 @@ airflow/providers/common/compat/openlineage/utils/sql.py,sha256=bQdfjBgkHNt0cFKd
|
|
|
17
19
|
airflow/providers/common/compat/openlineage/utils/utils.py,sha256=KB_1emJIEeYxPG7YscYHmIEDIx9VNmUPtDFz81UuhQk,1617
|
|
18
20
|
airflow/providers/common/compat/security/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
|
19
21
|
airflow/providers/common/compat/security/permissions.py,sha256=lkmW7IyE56sK0xPdc2dg7EeuS_EJBVfERoSD_Ct7lf0,1448
|
|
22
|
+
airflow/providers/common/compat/sqlalchemy/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
|
23
|
+
airflow/providers/common/compat/sqlalchemy/orm.py,sha256=Bli4zuEVkthtQVwbr35wKXx7cdVM01kIfSMPH2GHPs0,1046
|
|
20
24
|
airflow/providers/common/compat/standard/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
|
21
|
-
airflow/providers/common/compat/standard/operators.py,sha256=
|
|
22
|
-
airflow/providers/common/compat/standard/triggers.py,sha256=
|
|
23
|
-
airflow/providers/common/compat/standard/utils.py,sha256=
|
|
24
|
-
apache_airflow_providers_common_compat-1.
|
|
25
|
-
apache_airflow_providers_common_compat-1.
|
|
26
|
-
apache_airflow_providers_common_compat-1.
|
|
27
|
-
apache_airflow_providers_common_compat-1.
|
|
25
|
+
airflow/providers/common/compat/standard/operators.py,sha256=MUQelwNbAbgdrA2RJkK2SJDz5AvhQ9VW6sr328r6khQ,1599
|
|
26
|
+
airflow/providers/common/compat/standard/triggers.py,sha256=ZGqIvGtliogw5-avmTm_4oY-7nX1pbeCk7jLz3vb3Ck,1157
|
|
27
|
+
airflow/providers/common/compat/standard/utils.py,sha256=GN38uPDqhpPaFD1CQAEQuSG2FAY8pJ_Q_-EIFDE7D08,1335
|
|
28
|
+
apache_airflow_providers_common_compat-1.8.0rc1.dist-info/entry_points.txt,sha256=OdOClAuY8E82VvA-Zo6narFujtXdGihHKZH2HfmlPIo,109
|
|
29
|
+
apache_airflow_providers_common_compat-1.8.0rc1.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
|
30
|
+
apache_airflow_providers_common_compat-1.8.0rc1.dist-info/METADATA,sha256=LdRy4uQa7r_ivPAnbOqlWzihIqABd4gW2Yf3QjWrSgk,5540
|
|
31
|
+
apache_airflow_providers_common_compat-1.8.0rc1.dist-info/RECORD,,
|
|
File without changes
|