apache-airflow-providers-common-compat 1.2.2rc1__tar.gz → 1.3.0rc1__tar.gz
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.
Potentially problematic release.
This version of apache-airflow-providers-common-compat might be problematic. Click here for more details.
- {apache_airflow_providers_common_compat-1.2.2rc1 → apache_airflow_providers_common_compat-1.3.0rc1}/PKG-INFO +9 -9
- {apache_airflow_providers_common_compat-1.2.2rc1 → apache_airflow_providers_common_compat-1.3.0rc1}/README.rst +4 -4
- {apache_airflow_providers_common_compat-1.2.2rc1 → apache_airflow_providers_common_compat-1.3.0rc1}/airflow/providers/common/compat/__init__.py +3 -3
- {apache_airflow_providers_common_compat-1.2.2rc1 → apache_airflow_providers_common_compat-1.3.0rc1}/airflow/providers/common/compat/assets/__init__.py +17 -38
- {apache_airflow_providers_common_compat-1.2.2rc1 → apache_airflow_providers_common_compat-1.3.0rc1}/airflow/providers/common/compat/get_provider_info.py +2 -2
- {apache_airflow_providers_common_compat-1.2.2rc1 → apache_airflow_providers_common_compat-1.3.0rc1}/airflow/providers/common/compat/lineage/hook.py +31 -22
- apache_airflow_providers_common_compat-1.3.0rc1/airflow/providers/common/compat/openlineage/utils/spark.py +68 -0
- {apache_airflow_providers_common_compat-1.2.2rc1 → apache_airflow_providers_common_compat-1.3.0rc1}/airflow/providers/common/compat/standard/operators.py +2 -6
- apache_airflow_providers_common_compat-1.3.0rc1/airflow/providers/common/compat/standard/triggers.py +31 -0
- apache_airflow_providers_common_compat-1.3.0rc1/airflow/providers/common/compat/version_compat.py +36 -0
- {apache_airflow_providers_common_compat-1.2.2rc1 → apache_airflow_providers_common_compat-1.3.0rc1}/pyproject.toml +5 -5
- {apache_airflow_providers_common_compat-1.2.2rc1 → apache_airflow_providers_common_compat-1.3.0rc1}/airflow/providers/common/compat/LICENSE +0 -0
- {apache_airflow_providers_common_compat-1.2.2rc1 → apache_airflow_providers_common_compat-1.3.0rc1}/airflow/providers/common/compat/lineage/__init__.py +0 -0
- {apache_airflow_providers_common_compat-1.2.2rc1 → apache_airflow_providers_common_compat-1.3.0rc1}/airflow/providers/common/compat/openlineage/__init__.py +0 -0
- {apache_airflow_providers_common_compat-1.2.2rc1 → apache_airflow_providers_common_compat-1.3.0rc1}/airflow/providers/common/compat/openlineage/facet.py +0 -0
- {apache_airflow_providers_common_compat-1.2.2rc1 → apache_airflow_providers_common_compat-1.3.0rc1}/airflow/providers/common/compat/openlineage/utils/__init__.py +0 -0
- {apache_airflow_providers_common_compat-1.2.2rc1 → apache_airflow_providers_common_compat-1.3.0rc1}/airflow/providers/common/compat/openlineage/utils/utils.py +0 -0
- {apache_airflow_providers_common_compat-1.2.2rc1 → apache_airflow_providers_common_compat-1.3.0rc1}/airflow/providers/common/compat/security/__init__.py +0 -0
- {apache_airflow_providers_common_compat-1.2.2rc1 → apache_airflow_providers_common_compat-1.3.0rc1}/airflow/providers/common/compat/security/permissions.py +0 -0
- {apache_airflow_providers_common_compat-1.2.2rc1 → apache_airflow_providers_common_compat-1.3.0rc1}/airflow/providers/common/compat/standard/__init__.py +0 -0
- {apache_airflow_providers_common_compat-1.2.2rc1 → apache_airflow_providers_common_compat-1.3.0rc1}/airflow/providers/common/compat/standard/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: apache-airflow-providers-common-compat
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.3.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>
|
|
@@ -20,15 +20,15 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
20
20
|
Classifier: Programming Language :: Python :: 3.11
|
|
21
21
|
Classifier: Programming Language :: Python :: 3.12
|
|
22
22
|
Classifier: Topic :: System :: Monitoring
|
|
23
|
-
Requires-Dist: apache-airflow>=2.
|
|
23
|
+
Requires-Dist: apache-airflow>=2.9.0rc0
|
|
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.apache.org/docs/apache-airflow-providers-common-compat/1.
|
|
28
|
-
Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-common-compat/1.
|
|
27
|
+
Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-common-compat/1.3.0/changelog.html
|
|
28
|
+
Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-common-compat/1.3.0
|
|
29
29
|
Project-URL: Slack Chat, https://s.apache.org/airflow-slack
|
|
30
30
|
Project-URL: Source Code, https://github.com/apache/airflow
|
|
31
|
-
Project-URL: Twitter, https://
|
|
31
|
+
Project-URL: Twitter, https://x.com/ApacheAirflow
|
|
32
32
|
Project-URL: YouTube, https://www.youtube.com/channel/UCSXwxpWZQ7XZ1WL3wqevChA/
|
|
33
33
|
Provides-Extra: openlineage
|
|
34
34
|
Provides-Extra: standard
|
|
@@ -77,7 +77,7 @@ Provides-Extra: standard
|
|
|
77
77
|
|
|
78
78
|
Package ``apache-airflow-providers-common-compat``
|
|
79
79
|
|
|
80
|
-
Release: ``1.
|
|
80
|
+
Release: ``1.3.0.rc1``
|
|
81
81
|
|
|
82
82
|
|
|
83
83
|
``Common Compatibility Provider - providing compatibility code for previous Airflow versions.``
|
|
@@ -90,7 +90,7 @@ This is a provider package for ``common.compat`` provider. All classes for this
|
|
|
90
90
|
are in ``airflow.providers.common.compat`` python package.
|
|
91
91
|
|
|
92
92
|
You can find package information and changelog for the provider
|
|
93
|
-
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-common-compat/1.
|
|
93
|
+
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-common-compat/1.3.0/>`_.
|
|
94
94
|
|
|
95
95
|
Installation
|
|
96
96
|
------------
|
|
@@ -107,7 +107,7 @@ Requirements
|
|
|
107
107
|
================== ==================
|
|
108
108
|
PIP package Version required
|
|
109
109
|
================== ==================
|
|
110
|
-
``apache-airflow`` ``>=2.
|
|
110
|
+
``apache-airflow`` ``>=2.9.0``
|
|
111
111
|
================== ==================
|
|
112
112
|
|
|
113
113
|
Cross provider package dependencies
|
|
@@ -131,4 +131,4 @@ Dependent package
|
|
|
131
131
|
============================================================================================================== ===============
|
|
132
132
|
|
|
133
133
|
The changelog for the provider package can be found in the
|
|
134
|
-
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-common-compat/1.
|
|
134
|
+
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-common-compat/1.3.0/changelog.html>`_.
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
|
|
43
43
|
Package ``apache-airflow-providers-common-compat``
|
|
44
44
|
|
|
45
|
-
Release: ``1.
|
|
45
|
+
Release: ``1.3.0.rc1``
|
|
46
46
|
|
|
47
47
|
|
|
48
48
|
``Common Compatibility Provider - providing compatibility code for previous Airflow versions.``
|
|
@@ -55,7 +55,7 @@ This is a provider package for ``common.compat`` provider. All classes for this
|
|
|
55
55
|
are in ``airflow.providers.common.compat`` python package.
|
|
56
56
|
|
|
57
57
|
You can find package information and changelog for the provider
|
|
58
|
-
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-common-compat/1.
|
|
58
|
+
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-common-compat/1.3.0/>`_.
|
|
59
59
|
|
|
60
60
|
Installation
|
|
61
61
|
------------
|
|
@@ -72,7 +72,7 @@ Requirements
|
|
|
72
72
|
================== ==================
|
|
73
73
|
PIP package Version required
|
|
74
74
|
================== ==================
|
|
75
|
-
``apache-airflow`` ``>=2.
|
|
75
|
+
``apache-airflow`` ``>=2.9.0``
|
|
76
76
|
================== ==================
|
|
77
77
|
|
|
78
78
|
Cross provider package dependencies
|
|
@@ -96,4 +96,4 @@ Dependent package
|
|
|
96
96
|
============================================================================================================== ===============
|
|
97
97
|
|
|
98
98
|
The changelog for the provider package can be found in the
|
|
99
|
-
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-common-compat/1.
|
|
99
|
+
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-common-compat/1.3.0/changelog.html>`_.
|
|
@@ -29,11 +29,11 @@ from airflow import __version__ as airflow_version
|
|
|
29
29
|
|
|
30
30
|
__all__ = ["__version__"]
|
|
31
31
|
|
|
32
|
-
__version__ = "1.
|
|
32
|
+
__version__ = "1.3.0"
|
|
33
33
|
|
|
34
34
|
if packaging.version.parse(packaging.version.parse(airflow_version).base_version) < packaging.version.parse(
|
|
35
|
-
"2.
|
|
35
|
+
"2.9.0"
|
|
36
36
|
):
|
|
37
37
|
raise RuntimeError(
|
|
38
|
-
f"The package `apache-airflow-providers-common-compat:{__version__}` needs Apache Airflow 2.
|
|
38
|
+
f"The package `apache-airflow-providers-common-compat:{__version__}` needs Apache Airflow 2.9.0+"
|
|
39
39
|
)
|
|
@@ -19,52 +19,32 @@ from __future__ import annotations
|
|
|
19
19
|
|
|
20
20
|
from typing import TYPE_CHECKING
|
|
21
21
|
|
|
22
|
-
from airflow import
|
|
22
|
+
from airflow.providers.common.compat.version_compat import (
|
|
23
|
+
AIRFLOW_V_2_10_PLUS,
|
|
24
|
+
AIRFLOW_V_3_0_PLUS,
|
|
25
|
+
)
|
|
23
26
|
|
|
24
27
|
if TYPE_CHECKING:
|
|
25
|
-
from airflow.assets import (
|
|
26
|
-
Asset,
|
|
27
|
-
AssetAlias,
|
|
28
|
-
AssetAliasEvent,
|
|
29
|
-
AssetAll,
|
|
30
|
-
AssetAny,
|
|
31
|
-
expand_alias_to_assets,
|
|
32
|
-
)
|
|
33
28
|
from airflow.auth.managers.models.resource_details import AssetDetails
|
|
29
|
+
from airflow.models.asset import expand_alias_to_assets
|
|
30
|
+
from airflow.sdk.definitions.asset import Asset, AssetAlias, AssetAll, AssetAny
|
|
34
31
|
else:
|
|
35
|
-
|
|
36
|
-
from airflow.assets import (
|
|
37
|
-
Asset,
|
|
38
|
-
AssetAlias,
|
|
39
|
-
AssetAliasEvent,
|
|
40
|
-
AssetAll,
|
|
41
|
-
AssetAny,
|
|
42
|
-
expand_alias_to_assets,
|
|
43
|
-
)
|
|
32
|
+
if AIRFLOW_V_3_0_PLUS:
|
|
44
33
|
from airflow.auth.managers.models.resource_details import AssetDetails
|
|
45
|
-
|
|
46
|
-
from
|
|
47
|
-
|
|
48
|
-
_IS_AIRFLOW_2_10_OR_HIGHER = Version(Version(AIRFLOW_VERSION).base_version) >= Version("2.10.0")
|
|
49
|
-
_IS_AIRFLOW_2_9_OR_HIGHER = Version(Version(AIRFLOW_VERSION).base_version) >= Version("2.9.0")
|
|
50
|
-
_IS_AIRFLOW_2_8_OR_HIGHER = Version(Version(AIRFLOW_VERSION).base_version) >= Version("2.8.0")
|
|
51
|
-
|
|
34
|
+
from airflow.models.asset import expand_alias_to_assets
|
|
35
|
+
from airflow.sdk.definitions.asset import Asset, AssetAlias, AssetAll, AssetAny
|
|
36
|
+
else:
|
|
52
37
|
# dataset is renamed to asset since Airflow 3.0
|
|
53
|
-
from airflow.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
from airflow.datasets import (
|
|
60
|
-
DatasetAll as AssetAll,
|
|
61
|
-
DatasetAny as AssetAny,
|
|
62
|
-
)
|
|
38
|
+
from airflow.auth.managers.models.resource_details import DatasetDetails as AssetDetails
|
|
39
|
+
from airflow.datasets import (
|
|
40
|
+
Dataset as Asset,
|
|
41
|
+
DatasetAll as AssetAll,
|
|
42
|
+
DatasetAny as AssetAny,
|
|
43
|
+
)
|
|
63
44
|
|
|
64
|
-
if
|
|
45
|
+
if AIRFLOW_V_2_10_PLUS:
|
|
65
46
|
from airflow.datasets import (
|
|
66
47
|
DatasetAlias as AssetAlias,
|
|
67
|
-
DatasetAliasEvent as AssetAliasEvent,
|
|
68
48
|
expand_alias_to_datasets as expand_alias_to_assets,
|
|
69
49
|
)
|
|
70
50
|
|
|
@@ -72,7 +52,6 @@ else:
|
|
|
72
52
|
__all__ = [
|
|
73
53
|
"Asset",
|
|
74
54
|
"AssetAlias",
|
|
75
|
-
"AssetAliasEvent",
|
|
76
55
|
"AssetAll",
|
|
77
56
|
"AssetAny",
|
|
78
57
|
"AssetDetails",
|
|
@@ -29,8 +29,8 @@ def get_provider_info():
|
|
|
29
29
|
"description": "``Common Compatibility Provider - providing compatibility code for previous Airflow versions.``\n",
|
|
30
30
|
"state": "ready",
|
|
31
31
|
"source-date-epoch": 1731569875,
|
|
32
|
-
"versions": ["1.2.2", "1.2.1", "1.2.0", "1.1.0", "1.0.0"],
|
|
33
|
-
"dependencies": ["apache-airflow>=2.
|
|
32
|
+
"versions": ["1.3.0", "1.2.2", "1.2.1", "1.2.0", "1.1.0", "1.0.0"],
|
|
33
|
+
"dependencies": ["apache-airflow>=2.9.0"],
|
|
34
34
|
"integrations": [
|
|
35
35
|
{
|
|
36
36
|
"integration-name": "Common Compat",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
# under the License.
|
|
17
17
|
from __future__ import annotations
|
|
18
18
|
|
|
19
|
-
from
|
|
19
|
+
from airflow.providers.common.compat.version_compat import AIRFLOW_V_2_10_PLUS, AIRFLOW_V_3_0_PLUS
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
def _get_asset_compat_hook_lineage_collector():
|
|
@@ -38,7 +38,7 @@ def _get_asset_compat_hook_lineage_collector():
|
|
|
38
38
|
|
|
39
39
|
DatasetLineageInfo.asset = DatasetLineageInfo.dataset
|
|
40
40
|
|
|
41
|
-
def
|
|
41
|
+
def rename_asset_kwargs_to_dataset_kwargs(function):
|
|
42
42
|
@wraps(function)
|
|
43
43
|
def wrapper(*args, **kwargs):
|
|
44
44
|
if "asset_kwargs" in kwargs:
|
|
@@ -51,9 +51,9 @@ def _get_asset_compat_hook_lineage_collector():
|
|
|
51
51
|
|
|
52
52
|
return wrapper
|
|
53
53
|
|
|
54
|
-
collector.create_asset =
|
|
55
|
-
collector.add_input_asset =
|
|
56
|
-
collector.add_output_asset =
|
|
54
|
+
collector.create_asset = rename_asset_kwargs_to_dataset_kwargs(collector.create_dataset)
|
|
55
|
+
collector.add_input_asset = rename_asset_kwargs_to_dataset_kwargs(collector.add_input_dataset)
|
|
56
|
+
collector.add_output_asset = rename_asset_kwargs_to_dataset_kwargs(collector.add_output_dataset)
|
|
57
57
|
|
|
58
58
|
def collected_assets_compat(collector) -> HookLineage:
|
|
59
59
|
"""Get the collected hook lineage information."""
|
|
@@ -79,28 +79,37 @@ def _get_asset_compat_hook_lineage_collector():
|
|
|
79
79
|
|
|
80
80
|
|
|
81
81
|
def get_hook_lineage_collector():
|
|
82
|
-
#
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
# Dataset has been renamed as Asset in 3.0
|
|
86
|
-
from airflow.lineage.hook import get_hook_lineage_collector
|
|
82
|
+
# Dataset has been renamed as Asset in 3.0
|
|
83
|
+
if AIRFLOW_V_3_0_PLUS:
|
|
84
|
+
from airflow.lineage.hook import get_hook_lineage_collector
|
|
87
85
|
|
|
88
|
-
|
|
86
|
+
return get_hook_lineage_collector()
|
|
89
87
|
|
|
88
|
+
# HookLineageCollector added in 2.10
|
|
89
|
+
if AIRFLOW_V_2_10_PLUS:
|
|
90
90
|
return _get_asset_compat_hook_lineage_collector()
|
|
91
|
-
except ImportError:
|
|
92
91
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
# For the case that airflow has not yet upgraded to 2.10 or higher,
|
|
93
|
+
# but using the providers that already uses `get_hook_lineage_collector`
|
|
94
|
+
class NoOpCollector:
|
|
95
|
+
"""
|
|
96
|
+
NoOpCollector is a hook lineage collector that does nothing.
|
|
97
|
+
|
|
98
|
+
It is used when you want to disable lineage collection.
|
|
99
|
+
"""
|
|
100
|
+
|
|
101
|
+
# for providers that support asset rename
|
|
102
|
+
def add_input_asset(self, *_, **__):
|
|
103
|
+
pass
|
|
96
104
|
|
|
97
|
-
|
|
98
|
-
|
|
105
|
+
def add_output_asset(self, *_, **__):
|
|
106
|
+
pass
|
|
99
107
|
|
|
100
|
-
|
|
101
|
-
|
|
108
|
+
# for providers that do not support asset rename
|
|
109
|
+
def add_input_dataset(self, *_, **__):
|
|
110
|
+
pass
|
|
102
111
|
|
|
103
|
-
|
|
104
|
-
|
|
112
|
+
def add_output_dataset(self, *_, **__):
|
|
113
|
+
pass
|
|
105
114
|
|
|
106
|
-
|
|
115
|
+
return NoOpCollector()
|
|
@@ -0,0 +1,68 @@
|
|
|
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
|
+
import logging
|
|
21
|
+
from typing import TYPE_CHECKING
|
|
22
|
+
|
|
23
|
+
log = logging.getLogger(__name__)
|
|
24
|
+
|
|
25
|
+
if TYPE_CHECKING:
|
|
26
|
+
from airflow.providers.openlineage.utils.spark import inject_parent_job_information_into_spark_properties
|
|
27
|
+
else:
|
|
28
|
+
try:
|
|
29
|
+
from airflow.providers.openlineage.utils.spark import (
|
|
30
|
+
inject_parent_job_information_into_spark_properties,
|
|
31
|
+
)
|
|
32
|
+
except ImportError:
|
|
33
|
+
try:
|
|
34
|
+
from airflow.providers.openlineage.plugins.macros import (
|
|
35
|
+
lineage_job_name,
|
|
36
|
+
lineage_job_namespace,
|
|
37
|
+
lineage_run_id,
|
|
38
|
+
)
|
|
39
|
+
except ImportError:
|
|
40
|
+
|
|
41
|
+
def inject_parent_job_information_into_spark_properties(properties: dict, context) -> dict:
|
|
42
|
+
log.warning(
|
|
43
|
+
"Could not import `airflow.providers.openlineage.plugins.macros`."
|
|
44
|
+
"Skipping the injection of OpenLineage parent job information into Spark properties."
|
|
45
|
+
)
|
|
46
|
+
return properties
|
|
47
|
+
|
|
48
|
+
else:
|
|
49
|
+
|
|
50
|
+
def inject_parent_job_information_into_spark_properties(properties: dict, context) -> dict:
|
|
51
|
+
if any(str(key).startswith("spark.openlineage.parent") for key in properties):
|
|
52
|
+
log.info(
|
|
53
|
+
"Some OpenLineage properties with parent job information are already present "
|
|
54
|
+
"in Spark properties. Skipping the injection of OpenLineage "
|
|
55
|
+
"parent job information into Spark properties."
|
|
56
|
+
)
|
|
57
|
+
return properties
|
|
58
|
+
|
|
59
|
+
ti = context["ti"]
|
|
60
|
+
ol_parent_job_properties = {
|
|
61
|
+
"spark.openlineage.parentJobNamespace": lineage_job_namespace(),
|
|
62
|
+
"spark.openlineage.parentJobName": lineage_job_name(ti),
|
|
63
|
+
"spark.openlineage.parentRunId": lineage_run_id(ti),
|
|
64
|
+
}
|
|
65
|
+
return {**properties, **ol_parent_job_properties}
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
__all__ = ["inject_parent_job_information_into_spark_properties"]
|
|
@@ -19,7 +19,7 @@ from __future__ import annotations
|
|
|
19
19
|
|
|
20
20
|
from typing import TYPE_CHECKING
|
|
21
21
|
|
|
22
|
-
from airflow import
|
|
22
|
+
from airflow.providers.common.compat.version_compat import AIRFLOW_V_2_10_PLUS
|
|
23
23
|
|
|
24
24
|
if TYPE_CHECKING:
|
|
25
25
|
from airflow.providers.standard.operators.python import (
|
|
@@ -37,17 +37,13 @@ else:
|
|
|
37
37
|
get_current_context,
|
|
38
38
|
)
|
|
39
39
|
except ModuleNotFoundError:
|
|
40
|
-
from packaging.version import Version
|
|
41
|
-
|
|
42
|
-
_IS_AIRFLOW_2_10_OR_HIGHER = Version(Version(AIRFLOW_VERSION).base_version) >= Version("2.10.0")
|
|
43
|
-
|
|
44
40
|
from airflow.operators.python import (
|
|
45
41
|
PythonOperator,
|
|
46
42
|
ShortCircuitOperator,
|
|
47
43
|
get_current_context,
|
|
48
44
|
)
|
|
49
45
|
|
|
50
|
-
if
|
|
46
|
+
if AIRFLOW_V_2_10_PLUS:
|
|
51
47
|
from airflow.operators.python import _SERIALIZERS
|
|
52
48
|
|
|
53
49
|
|
apache_airflow_providers_common_compat-1.3.0rc1/airflow/providers/common/compat/standard/triggers.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
from typing import TYPE_CHECKING
|
|
21
|
+
|
|
22
|
+
if TYPE_CHECKING:
|
|
23
|
+
from airflow.providers.standard.triggers.temporal import TimeDeltaTrigger
|
|
24
|
+
else:
|
|
25
|
+
try:
|
|
26
|
+
from airflow.providers.standard.triggers.temporal import TimeDeltaTrigger
|
|
27
|
+
except ModuleNotFoundError:
|
|
28
|
+
from airflow.triggers.temporal import TimeDeltaTrigger
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
__all__ = ["TimeDeltaTrigger"]
|
apache_airflow_providers_common_compat-1.3.0rc1/airflow/providers/common/compat/version_compat.py
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
# NOTE! THIS FILE IS COPIED MANUALLY IN OTHER PROVIDERS DELIBERATELY TO AVOID ADDING UNNECESSARY
|
|
19
|
+
# DEPENDENCIES BETWEEN PROVIDERS. IF YOU WANT TO ADD CONDITIONAL CODE IN YOUR PROVIDER THAT DEPENDS
|
|
20
|
+
# ON AIRFLOW VERSION, PLEASE COPY THIS FILE TO THE ROOT PACKAGE OF YOUR PROVIDER AND IMPORT
|
|
21
|
+
# THOSE CONSTANTS FROM IT RATHER THAN IMPORTING THEM FROM ANOTHER PROVIDER OR TEST CODE
|
|
22
|
+
#
|
|
23
|
+
from __future__ import annotations
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def get_base_airflow_version_tuple() -> tuple[int, int, int]:
|
|
27
|
+
from packaging.version import Version
|
|
28
|
+
|
|
29
|
+
from airflow import __version__
|
|
30
|
+
|
|
31
|
+
airflow_version = Version(__version__)
|
|
32
|
+
return airflow_version.major, airflow_version.minor, airflow_version.micro
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
AIRFLOW_V_2_10_PLUS = get_base_airflow_version_tuple() >= (2, 10, 0)
|
|
36
|
+
AIRFLOW_V_3_0_PLUS = get_base_airflow_version_tuple() >= (3, 0, 0)
|
|
@@ -27,7 +27,7 @@ build-backend = "flit_core.buildapi"
|
|
|
27
27
|
|
|
28
28
|
[project]
|
|
29
29
|
name = "apache-airflow-providers-common-compat"
|
|
30
|
-
version = "1.
|
|
30
|
+
version = "1.3.0.rc1"
|
|
31
31
|
description = "Provider package apache-airflow-providers-common-compat for Apache Airflow"
|
|
32
32
|
readme = "README.rst"
|
|
33
33
|
authors = [
|
|
@@ -54,16 +54,16 @@ classifiers = [
|
|
|
54
54
|
]
|
|
55
55
|
requires-python = "~=3.9"
|
|
56
56
|
dependencies = [
|
|
57
|
-
"apache-airflow>=2.
|
|
57
|
+
"apache-airflow>=2.9.0rc0",
|
|
58
58
|
]
|
|
59
59
|
|
|
60
60
|
[project.urls]
|
|
61
|
-
"Documentation" = "https://airflow.apache.org/docs/apache-airflow-providers-common-compat/1.
|
|
62
|
-
"Changelog" = "https://airflow.apache.org/docs/apache-airflow-providers-common-compat/1.
|
|
61
|
+
"Documentation" = "https://airflow.apache.org/docs/apache-airflow-providers-common-compat/1.3.0"
|
|
62
|
+
"Changelog" = "https://airflow.apache.org/docs/apache-airflow-providers-common-compat/1.3.0/changelog.html"
|
|
63
63
|
"Bug Tracker" = "https://github.com/apache/airflow/issues"
|
|
64
64
|
"Source Code" = "https://github.com/apache/airflow"
|
|
65
65
|
"Slack Chat" = "https://s.apache.org/airflow-slack"
|
|
66
|
-
"Twitter" = "https://
|
|
66
|
+
"Twitter" = "https://x.com/ApacheAirflow"
|
|
67
67
|
"YouTube" = "https://www.youtube.com/channel/UCSXwxpWZQ7XZ1WL3wqevChA/"
|
|
68
68
|
|
|
69
69
|
[project.entry-points."apache_airflow_provider"]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|