apache-airflow-providers-common-compat 1.7.4rc1__tar.gz → 1.8.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.

Files changed (62) hide show
  1. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/PKG-INFO +6 -7
  2. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/README.rst +3 -4
  3. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/docs/changelog.rst +26 -2
  4. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/docs/index.rst +3 -4
  5. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/provider.yaml +2 -1
  6. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/pyproject.toml +3 -4
  7. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/src/airflow/providers/common/compat/__init__.py +1 -1
  8. apache_airflow_providers_common_compat-1.8.0rc1/src/airflow/providers/common/compat/_compat_utils.py +105 -0
  9. apache_airflow_providers_common_compat-1.8.0rc1/src/airflow/providers/common/compat/sdk.py +219 -0
  10. apache_airflow_providers_common_compat-1.8.0rc1/src/airflow/providers/common/compat/sqlalchemy/orm.py +27 -0
  11. apache_airflow_providers_common_compat-1.7.4rc1/src/airflow/providers/common/compat/standard/triggers.py → apache_airflow_providers_common_compat-1.8.0rc1/src/airflow/providers/common/compat/standard/operators.py +12 -9
  12. apache_airflow_providers_common_compat-1.8.0rc1/src/airflow/providers/common/compat/standard/triggers.py +28 -0
  13. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/src/airflow/providers/common/compat/standard/utils.py +13 -9
  14. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/tests/unit/common/compat/openlineage/test_check.py +4 -15
  15. apache_airflow_providers_common_compat-1.8.0rc1/tests/unit/common/compat/security/__init__.py +16 -0
  16. apache_airflow_providers_common_compat-1.8.0rc1/tests/unit/common/compat/sqlalchemy/__init__.py +16 -0
  17. apache_airflow_providers_common_compat-1.8.0rc1/tests/unit/common/compat/sqlalchemy/test_orm.py +145 -0
  18. apache_airflow_providers_common_compat-1.8.0rc1/tests/unit/common/compat/test__compat_utils.py +215 -0
  19. apache_airflow_providers_common_compat-1.8.0rc1/tests/unit/common/compat/test_sdk.py +54 -0
  20. apache_airflow_providers_common_compat-1.7.4rc1/src/airflow/providers/common/compat/standard/operators.py +0 -51
  21. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/docs/.latest-doc-only-change.txt +0 -0
  22. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/docs/commits.rst +0 -0
  23. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/docs/conf.py +0 -0
  24. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/docs/installing-providers-from-sources.rst +0 -0
  25. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/docs/security.rst +0 -0
  26. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/src/airflow/__init__.py +0 -0
  27. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/src/airflow/providers/__init__.py +0 -0
  28. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/src/airflow/providers/common/__init__.py +0 -0
  29. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/src/airflow/providers/common/compat/LICENSE +0 -0
  30. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/src/airflow/providers/common/compat/assets/__init__.py +0 -0
  31. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/src/airflow/providers/common/compat/check.py +0 -0
  32. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/src/airflow/providers/common/compat/get_provider_info.py +0 -0
  33. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/src/airflow/providers/common/compat/lineage/__init__.py +0 -0
  34. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/src/airflow/providers/common/compat/lineage/entities.py +0 -0
  35. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/src/airflow/providers/common/compat/lineage/hook.py +0 -0
  36. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/src/airflow/providers/common/compat/notifier/__init__.py +0 -0
  37. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/src/airflow/providers/common/compat/openlineage/__init__.py +0 -0
  38. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/src/airflow/providers/common/compat/openlineage/check.py +0 -0
  39. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/src/airflow/providers/common/compat/openlineage/facet.py +0 -0
  40. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/src/airflow/providers/common/compat/openlineage/utils/__init__.py +0 -0
  41. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/src/airflow/providers/common/compat/openlineage/utils/spark.py +0 -0
  42. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/src/airflow/providers/common/compat/openlineage/utils/sql.py +0 -0
  43. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/src/airflow/providers/common/compat/openlineage/utils/utils.py +0 -0
  44. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/src/airflow/providers/common/compat/security/__init__.py +0 -0
  45. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/src/airflow/providers/common/compat/security/permissions.py +0 -0
  46. {apache_airflow_providers_common_compat-1.7.4rc1/src/airflow/providers/common/compat/standard → apache_airflow_providers_common_compat-1.8.0rc1/src/airflow/providers/common/compat/sqlalchemy}/__init__.py +0 -0
  47. {apache_airflow_providers_common_compat-1.7.4rc1/tests/unit/common/compat → apache_airflow_providers_common_compat-1.8.0rc1/src/airflow/providers/common/compat/standard}/__init__.py +0 -0
  48. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/src/airflow/providers/common/compat/version_compat.py +0 -0
  49. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/tests/conftest.py +0 -0
  50. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/tests/unit/__init__.py +0 -0
  51. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/tests/unit/common/__init__.py +0 -0
  52. {apache_airflow_providers_common_compat-1.7.4rc1/tests/unit/common/compat/lineage → apache_airflow_providers_common_compat-1.8.0rc1/tests/unit/common/compat}/__init__.py +0 -0
  53. {apache_airflow_providers_common_compat-1.7.4rc1/tests/unit/common/compat/openlineage → apache_airflow_providers_common_compat-1.8.0rc1/tests/unit/common/compat/lineage}/__init__.py +0 -0
  54. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/tests/unit/common/compat/lineage/test_hook.py +0 -0
  55. {apache_airflow_providers_common_compat-1.7.4rc1/tests/unit/common/compat/openlineage/utils → apache_airflow_providers_common_compat-1.8.0rc1/tests/unit/common/compat/openlineage}/__init__.py +0 -0
  56. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/tests/unit/common/compat/openlineage/test_facet.py +0 -0
  57. {apache_airflow_providers_common_compat-1.7.4rc1/tests/unit/common/compat/security → apache_airflow_providers_common_compat-1.8.0rc1/tests/unit/common/compat/openlineage/utils}/__init__.py +0 -0
  58. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/tests/unit/common/compat/openlineage/utils/test_spark.py +0 -0
  59. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/tests/unit/common/compat/openlineage/utils/test_sql.py +0 -0
  60. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/tests/unit/common/compat/openlineage/utils/test_utils.py +0 -0
  61. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/tests/unit/common/compat/security/test_permissions.py +0 -0
  62. {apache_airflow_providers_common_compat-1.7.4rc1 → apache_airflow_providers_common_compat-1.8.0rc1}/tests/unit/common/compat/test_check.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: apache-airflow-providers-common-compat
3
- Version: 1.7.4rc1
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.7.4/changelog.html
28
- Project-URL: Documentation, https://airflow.staged.apache.org/docs/apache-airflow-providers-common-compat/1.7.4
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.7.4``
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.7.4/>`_.
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.7.4/changelog.html>`_.
124
+ `changelog <https://airflow.apache.org/docs/apache-airflow-providers-common-compat/1.8.0/changelog.html>`_.
126
125
 
@@ -23,7 +23,7 @@
23
23
 
24
24
  Package ``apache-airflow-providers-common-compat``
25
25
 
26
- Release: ``1.7.4``
26
+ Release: ``1.8.0``
27
27
 
28
28
 
29
29
  Common Compatibility Provider - providing compatibility code for previous Airflow versions
@@ -36,7 +36,7 @@ This is a provider package for ``common.compat`` provider. All classes for this
36
36
  are in ``airflow.providers.common.compat`` python package.
37
37
 
38
38
  You can find package information and changelog for the provider
39
- in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-common-compat/1.7.4/>`_.
39
+ in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-common-compat/1.8.0/>`_.
40
40
 
41
41
  Installation
42
42
  ------------
@@ -73,7 +73,6 @@ You can install such cross-provider dependencies when installing from PyPI. For
73
73
  Dependent package Extra
74
74
  ============================================================================================================== ===============
75
75
  `apache-airflow-providers-openlineage <https://airflow.apache.org/docs/apache-airflow-providers-openlineage>`_ ``openlineage``
76
- `apache-airflow-providers-standard <https://airflow.apache.org/docs/apache-airflow-providers-standard>`_ ``standard``
77
76
  ============================================================================================================== ===============
78
77
 
79
78
  Optional dependencies
@@ -87,4 +86,4 @@ Extra Dependencies
87
86
  =============== ========================================
88
87
 
89
88
  The changelog for the provider package can be found in the
90
- `changelog <https://airflow.apache.org/docs/apache-airflow-providers-common-compat/1.7.4/changelog.html>`_.
89
+ `changelog <https://airflow.apache.org/docs/apache-airflow-providers-common-compat/1.8.0/changelog.html>`_.
@@ -25,11 +25,35 @@
25
25
  Changelog
26
26
  ---------
27
27
 
28
- 1.7.4
28
+ 1.8.0
29
29
  .....
30
30
 
31
+ Features
32
+ ~~~~~~~~
33
+
34
+ * ``Simplify version-specific imports in the Standard provider (#56867)``
35
+ * ``Add SQLA's 'mapped_column' to common-compat (#56880)``
36
+ * ``Add comprehensive compatibility imports for Airflow 2 to 3 migration (#56790)``
37
+
38
+ Misc
39
+ ~~~~
40
+
41
+ * ``Common.Compat: Extract reusable compat utilities and rename to sdk (#56884)``
42
+ * ``Simplify version-specific imports in the Google provider (#56793)``
43
+ * ``Migrate Apache providers & Elasticsearch to ''common.compat'' (#57016)``
44
+
45
+ Doc-only
46
+ ~~~~~~~~
47
+
48
+ * ``Remove placeholder Release Date in changelog and index files (#56056)``
49
+
50
+ .. Below changes are excluded from the changelog. Move them to
51
+ appropriate section above if needed. Do not delete the lines(!):
52
+ * ``Enable PT011 rule to prvoider tests (#56495)``
53
+
54
+ 1.7.4
55
+ .....
31
56
 
32
- Release Date: ``|PypiReleaseDate|``
33
57
 
34
58
  Misc
35
59
  ~~~~
@@ -62,7 +62,7 @@ apache-airflow-providers-common-compat package
62
62
  Common Compatibility Provider - providing compatibility code for previous Airflow versions
63
63
 
64
64
 
65
- Release: 1.7.4
65
+ Release: 1.8.0
66
66
 
67
67
  Provider package
68
68
  ----------------
@@ -105,7 +105,6 @@ You can install such cross-provider dependencies when installing from PyPI. For
105
105
  Dependent package Extra
106
106
  ============================================================================================================== ===============
107
107
  `apache-airflow-providers-openlineage <https://airflow.apache.org/docs/apache-airflow-providers-openlineage>`_ ``openlineage``
108
- `apache-airflow-providers-standard <https://airflow.apache.org/docs/apache-airflow-providers-standard>`_ ``standard``
109
108
  ============================================================================================================== ===============
110
109
 
111
110
  Downloading official packages
@@ -114,5 +113,5 @@ Downloading official packages
114
113
  You can download officially released packages and verify their checksums and signatures from the
115
114
  `Official Apache Download site <https://downloads.apache.org/airflow/providers/>`_
116
115
 
117
- * `The apache-airflow-providers-common-compat 1.7.4 sdist package <https://downloads.apache.org/airflow/providers/apache_airflow_providers_common_compat-1.7.4.tar.gz>`_ (`asc <https://downloads.apache.org/airflow/providers/apache_airflow_providers_common_compat-1.7.4.tar.gz.asc>`__, `sha512 <https://downloads.apache.org/airflow/providers/apache_airflow_providers_common_compat-1.7.4.tar.gz.sha512>`__)
118
- * `The apache-airflow-providers-common-compat 1.7.4 wheel package <https://downloads.apache.org/airflow/providers/apache_airflow_providers_common_compat-1.7.4-py3-none-any.whl>`_ (`asc <https://downloads.apache.org/airflow/providers/apache_airflow_providers_common_compat-1.7.4-py3-none-any.whl.asc>`__, `sha512 <https://downloads.apache.org/airflow/providers/apache_airflow_providers_common_compat-1.7.4-py3-none-any.whl.sha512>`__)
116
+ * `The apache-airflow-providers-common-compat 1.8.0 sdist package <https://downloads.apache.org/airflow/providers/apache_airflow_providers_common_compat-1.8.0.tar.gz>`_ (`asc <https://downloads.apache.org/airflow/providers/apache_airflow_providers_common_compat-1.8.0.tar.gz.asc>`__, `sha512 <https://downloads.apache.org/airflow/providers/apache_airflow_providers_common_compat-1.8.0.tar.gz.sha512>`__)
117
+ * `The apache-airflow-providers-common-compat 1.8.0 wheel package <https://downloads.apache.org/airflow/providers/apache_airflow_providers_common_compat-1.8.0-py3-none-any.whl>`_ (`asc <https://downloads.apache.org/airflow/providers/apache_airflow_providers_common_compat-1.8.0-py3-none-any.whl.asc>`__, `sha512 <https://downloads.apache.org/airflow/providers/apache_airflow_providers_common_compat-1.8.0-py3-none-any.whl.sha512>`__)
@@ -22,12 +22,13 @@ description: |
22
22
  Common Compatibility Provider - providing compatibility code for previous Airflow versions
23
23
 
24
24
  state: ready
25
- source-date-epoch: 1757950105
25
+ source-date-epoch: 1761112092
26
26
  # Note that those versions are maintained by release manager - do not update them manually
27
27
  # with the exception of case where other provider in sources has >= new provider version.
28
28
  # In such case adding >= NEW_VERSION and bumping to NEW_VERSION in a provider have
29
29
  # to be done in the same PR
30
30
  versions:
31
+ - 1.8.0
31
32
  - 1.7.4
32
33
  - 1.7.3
33
34
  - 1.7.2
@@ -25,7 +25,7 @@ build-backend = "flit_core.buildapi"
25
25
 
26
26
  [project]
27
27
  name = "apache-airflow-providers-common-compat"
28
- version = "1.7.4rc1"
28
+ version = "1.8.0rc1"
29
29
  description = "Provider package apache-airflow-providers-common-compat for Apache Airflow"
30
30
  readme = "README.rst"
31
31
  authors = [
@@ -76,7 +76,6 @@ dev = [
76
76
  "apache-airflow-task-sdk",
77
77
  "apache-airflow-devel-common",
78
78
  "apache-airflow-providers-openlineage",
79
- "apache-airflow-providers-standard",
80
79
  # Additional devel dependencies (do not remove this line and add extra development dependencies)
81
80
  ]
82
81
 
@@ -106,8 +105,8 @@ apache-airflow-providers-common-sql = {workspace = true}
106
105
  apache-airflow-providers-standard = {workspace = true}
107
106
 
108
107
  [project.urls]
109
- "Documentation" = "https://airflow.staged.apache.org/docs/apache-airflow-providers-common-compat/1.7.4"
110
- "Changelog" = "https://airflow.staged.apache.org/docs/apache-airflow-providers-common-compat/1.7.4/changelog.html"
108
+ "Documentation" = "https://airflow.staged.apache.org/docs/apache-airflow-providers-common-compat/1.8.0"
109
+ "Changelog" = "https://airflow.staged.apache.org/docs/apache-airflow-providers-common-compat/1.8.0/changelog.html"
111
110
  "Bug Tracker" = "https://github.com/apache/airflow/issues"
112
111
  "Source Code" = "https://github.com/apache/airflow"
113
112
  "Slack Chat" = "https://s.apache.org/airflow-slack"
@@ -29,7 +29,7 @@ from airflow import __version__ as airflow_version
29
29
 
30
30
  __all__ = ["__version__"]
31
31
 
32
- __version__ = "1.7.4"
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,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,15 +17,18 @@
17
17
 
18
18
  from __future__ import annotations
19
19
 
20
- from typing import TYPE_CHECKING
20
+ from airflow.providers.common.compat._compat_utils import create_module_getattr
21
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
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
+ }
29
31
 
32
+ __getattr__ = create_module_getattr(import_map=_IMPORT_MAP)
30
33
 
31
- __all__ = ["TimeDeltaTrigger"]
34
+ __all__ = sorted(_IMPORT_MAP.keys())
@@ -0,0 +1,28 @@
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 airflow.providers.common.compat._compat_utils import create_module_getattr
21
+
22
+ _IMPORT_MAP: dict[str, str | tuple[str, ...]] = {
23
+ "TimeDeltaTrigger": ("airflow.providers.standard.triggers.temporal", "airflow.triggers.temporal"),
24
+ }
25
+
26
+ __getattr__ = create_module_getattr(import_map=_IMPORT_MAP)
27
+
28
+ __all__ = sorted(_IMPORT_MAP.keys())
@@ -17,15 +17,19 @@
17
17
 
18
18
  from __future__ import annotations
19
19
 
20
- from typing import TYPE_CHECKING
20
+ from airflow.providers.common.compat._compat_utils import create_module_getattr
21
21
 
22
- if TYPE_CHECKING:
23
- from airflow.providers.standard.utils.python_virtualenv import prepare_virtualenv, write_python_script
24
- else:
25
- try:
26
- from airflow.providers.standard.utils.python_virtualenv import prepare_virtualenv, write_python_script
27
- except ModuleNotFoundError:
28
- from airflow.utils.python_virtualenv import prepare_virtualenv, write_python_script
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__ = ["write_python_script", "prepare_virtualenv"]
35
+ __all__ = sorted(_IMPORT_MAP.keys())