apache-airflow-providers-openlineage 1.12.1__tar.gz → 1.12.2__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-openlineage might be problematic. Click here for more details.

Files changed (30) hide show
  1. {apache_airflow_providers_openlineage-1.12.1 → apache_airflow_providers_openlineage-1.12.2}/PKG-INFO +17 -15
  2. {apache_airflow_providers_openlineage-1.12.1 → apache_airflow_providers_openlineage-1.12.2}/README.rst +11 -10
  3. {apache_airflow_providers_openlineage-1.12.1 → apache_airflow_providers_openlineage-1.12.2}/airflow/providers/openlineage/__init__.py +1 -1
  4. {apache_airflow_providers_openlineage-1.12.1 → apache_airflow_providers_openlineage-1.12.2}/airflow/providers/openlineage/conf.py +1 -1
  5. {apache_airflow_providers_openlineage-1.12.1 → apache_airflow_providers_openlineage-1.12.2}/airflow/providers/openlineage/extractors/manager.py +17 -10
  6. {apache_airflow_providers_openlineage-1.12.1 → apache_airflow_providers_openlineage-1.12.2}/airflow/providers/openlineage/get_provider_info.py +3 -2
  7. apache_airflow_providers_openlineage-1.12.2/airflow/providers/openlineage/utils/asset_compat_lineage_collector.py +108 -0
  8. {apache_airflow_providers_openlineage-1.12.1 → apache_airflow_providers_openlineage-1.12.2}/airflow/providers/openlineage/utils/utils.py +26 -12
  9. {apache_airflow_providers_openlineage-1.12.1 → apache_airflow_providers_openlineage-1.12.2}/pyproject.toml +7 -5
  10. {apache_airflow_providers_openlineage-1.12.1 → apache_airflow_providers_openlineage-1.12.2}/airflow/providers/openlineage/LICENSE +0 -0
  11. {apache_airflow_providers_openlineage-1.12.1 → apache_airflow_providers_openlineage-1.12.2}/airflow/providers/openlineage/extractors/__init__.py +0 -0
  12. {apache_airflow_providers_openlineage-1.12.1 → apache_airflow_providers_openlineage-1.12.2}/airflow/providers/openlineage/extractors/base.py +0 -0
  13. {apache_airflow_providers_openlineage-1.12.1 → apache_airflow_providers_openlineage-1.12.2}/airflow/providers/openlineage/extractors/bash.py +0 -0
  14. {apache_airflow_providers_openlineage-1.12.1 → apache_airflow_providers_openlineage-1.12.2}/airflow/providers/openlineage/extractors/python.py +0 -0
  15. {apache_airflow_providers_openlineage-1.12.1 → apache_airflow_providers_openlineage-1.12.2}/airflow/providers/openlineage/facets/AirflowDagRunFacet.json +0 -0
  16. {apache_airflow_providers_openlineage-1.12.1 → apache_airflow_providers_openlineage-1.12.2}/airflow/providers/openlineage/facets/AirflowDebugRunFacet.json +0 -0
  17. {apache_airflow_providers_openlineage-1.12.1 → apache_airflow_providers_openlineage-1.12.2}/airflow/providers/openlineage/facets/AirflowJobFacet.json +0 -0
  18. {apache_airflow_providers_openlineage-1.12.1 → apache_airflow_providers_openlineage-1.12.2}/airflow/providers/openlineage/facets/AirflowRunFacet.json +0 -0
  19. {apache_airflow_providers_openlineage-1.12.1 → apache_airflow_providers_openlineage-1.12.2}/airflow/providers/openlineage/facets/AirflowStateRunFacet.json +0 -0
  20. {apache_airflow_providers_openlineage-1.12.1 → apache_airflow_providers_openlineage-1.12.2}/airflow/providers/openlineage/facets/__init__.py +0 -0
  21. {apache_airflow_providers_openlineage-1.12.1 → apache_airflow_providers_openlineage-1.12.2}/airflow/providers/openlineage/plugins/__init__.py +0 -0
  22. {apache_airflow_providers_openlineage-1.12.1 → apache_airflow_providers_openlineage-1.12.2}/airflow/providers/openlineage/plugins/adapter.py +0 -0
  23. {apache_airflow_providers_openlineage-1.12.1 → apache_airflow_providers_openlineage-1.12.2}/airflow/providers/openlineage/plugins/facets.py +0 -0
  24. {apache_airflow_providers_openlineage-1.12.1 → apache_airflow_providers_openlineage-1.12.2}/airflow/providers/openlineage/plugins/listener.py +0 -0
  25. {apache_airflow_providers_openlineage-1.12.1 → apache_airflow_providers_openlineage-1.12.2}/airflow/providers/openlineage/plugins/macros.py +0 -0
  26. {apache_airflow_providers_openlineage-1.12.1 → apache_airflow_providers_openlineage-1.12.2}/airflow/providers/openlineage/plugins/openlineage.py +0 -0
  27. {apache_airflow_providers_openlineage-1.12.1 → apache_airflow_providers_openlineage-1.12.2}/airflow/providers/openlineage/sqlparser.py +0 -0
  28. {apache_airflow_providers_openlineage-1.12.1 → apache_airflow_providers_openlineage-1.12.2}/airflow/providers/openlineage/utils/__init__.py +0 -0
  29. {apache_airflow_providers_openlineage-1.12.1 → apache_airflow_providers_openlineage-1.12.2}/airflow/providers/openlineage/utils/selective_enable.py +0 -0
  30. {apache_airflow_providers_openlineage-1.12.1 → apache_airflow_providers_openlineage-1.12.2}/airflow/providers/openlineage/utils/sql.py +0 -0
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: apache-airflow-providers-openlineage
3
- Version: 1.12.1
3
+ Version: 1.12.2
4
4
  Summary: Provider package apache-airflow-providers-openlineage for Apache Airflow
5
5
  Keywords: airflow-provider,openlineage,airflow,integration
6
6
  Author-email: Apache Software Foundation <dev@airflow.apache.org>
7
7
  Maintainer-email: Apache Software Foundation <dev@airflow.apache.org>
8
- Requires-Python: ~=3.8
8
+ Requires-Python: ~=3.9
9
9
  Description-Content-Type: text/x-rst
10
10
  Classifier: Development Status :: 5 - Production/Stable
11
11
  Classifier: Environment :: Console
@@ -15,7 +15,6 @@ Classifier: Intended Audience :: System Administrators
15
15
  Classifier: Framework :: Apache Airflow
16
16
  Classifier: Framework :: Apache Airflow :: Provider
17
17
  Classifier: License :: OSI Approved :: Apache Software License
18
- Classifier: Programming Language :: Python :: 3.8
19
18
  Classifier: Programming Language :: Python :: 3.9
20
19
  Classifier: Programming Language :: Python :: 3.10
21
20
  Classifier: Programming Language :: Python :: 3.11
@@ -27,14 +26,16 @@ Requires-Dist: apache-airflow>=2.8.0
27
26
  Requires-Dist: attrs>=22.2
28
27
  Requires-Dist: openlineage-integration-common>=1.22.0
29
28
  Requires-Dist: openlineage-python>=1.22.0
29
+ Requires-Dist: apache-airflow-providers-common-compat ; extra == "common.compat"
30
30
  Requires-Dist: apache-airflow-providers-common-sql ; extra == "common.sql"
31
31
  Project-URL: Bug Tracker, https://github.com/apache/airflow/issues
32
- Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.12.1/changelog.html
33
- Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.12.1
32
+ Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.12.2/changelog.html
33
+ Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.12.2
34
34
  Project-URL: Slack Chat, https://s.apache.org/airflow-slack
35
35
  Project-URL: Source Code, https://github.com/apache/airflow
36
36
  Project-URL: Twitter, https://twitter.com/ApacheAirflow
37
37
  Project-URL: YouTube, https://www.youtube.com/channel/UCSXwxpWZQ7XZ1WL3wqevChA/
38
+ Provides-Extra: common.compat
38
39
  Provides-Extra: common.sql
39
40
 
40
41
 
@@ -81,7 +82,7 @@ Provides-Extra: common.sql
81
82
 
82
83
  Package ``apache-airflow-providers-openlineage``
83
84
 
84
- Release: ``1.12.1``
85
+ Release: ``1.12.2``
85
86
 
86
87
 
87
88
  `OpenLineage <https://openlineage.io/>`__
@@ -94,7 +95,7 @@ This is a provider package for ``openlineage`` provider. All classes for this pr
94
95
  are in ``airflow.providers.openlineage`` python package.
95
96
 
96
97
  You can find package information and changelog for the provider
97
- in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.12.1/>`_.
98
+ in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.12.2/>`_.
98
99
 
99
100
  Installation
100
101
  ------------
@@ -103,7 +104,7 @@ You can install this package on top of an existing Airflow 2 installation (see `
103
104
  for the minimum Airflow version supported) via
104
105
  ``pip install apache-airflow-providers-openlineage``
105
106
 
106
- The package supports the following python versions: 3.8,3.9,3.10,3.11,3.12
107
+ The package supports the following python versions: 3.9,3.10,3.11,3.12
107
108
 
108
109
  Requirements
109
110
  ------------
@@ -129,14 +130,15 @@ You can install such cross-provider dependencies when installing from PyPI. For
129
130
 
130
131
  .. code-block:: bash
131
132
 
132
- pip install apache-airflow-providers-openlineage[common.sql]
133
+ pip install apache-airflow-providers-openlineage[common.compat]
133
134
 
134
135
 
135
- ============================================================================================================ ==============
136
- Dependent package Extra
137
- ============================================================================================================ ==============
138
- `apache-airflow-providers-common-sql <https://airflow.apache.org/docs/apache-airflow-providers-common-sql>`_ ``common.sql``
139
- ============================================================================================================ ==============
136
+ ================================================================================================================== =================
137
+ Dependent package Extra
138
+ ================================================================================================================== =================
139
+ `apache-airflow-providers-common-compat <https://airflow.apache.org/docs/apache-airflow-providers-common-compat>`_ ``common.compat``
140
+ `apache-airflow-providers-common-sql <https://airflow.apache.org/docs/apache-airflow-providers-common-sql>`_ ``common.sql``
141
+ ================================================================================================================== =================
140
142
 
141
143
  The changelog for the provider package can be found in the
142
- `changelog <https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.12.1/changelog.html>`_.
144
+ `changelog <https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.12.2/changelog.html>`_.
@@ -42,7 +42,7 @@
42
42
 
43
43
  Package ``apache-airflow-providers-openlineage``
44
44
 
45
- Release: ``1.12.1``
45
+ Release: ``1.12.2``
46
46
 
47
47
 
48
48
  `OpenLineage <https://openlineage.io/>`__
@@ -55,7 +55,7 @@ This is a provider package for ``openlineage`` provider. All classes for this pr
55
55
  are in ``airflow.providers.openlineage`` 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-openlineage/1.12.1/>`_.
58
+ in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.12.2/>`_.
59
59
 
60
60
  Installation
61
61
  ------------
@@ -64,7 +64,7 @@ You can install this package on top of an existing Airflow 2 installation (see `
64
64
  for the minimum Airflow version supported) via
65
65
  ``pip install apache-airflow-providers-openlineage``
66
66
 
67
- The package supports the following python versions: 3.8,3.9,3.10,3.11,3.12
67
+ The package supports the following python versions: 3.9,3.10,3.11,3.12
68
68
 
69
69
  Requirements
70
70
  ------------
@@ -90,14 +90,15 @@ You can install such cross-provider dependencies when installing from PyPI. For
90
90
 
91
91
  .. code-block:: bash
92
92
 
93
- pip install apache-airflow-providers-openlineage[common.sql]
93
+ pip install apache-airflow-providers-openlineage[common.compat]
94
94
 
95
95
 
96
- ============================================================================================================ ==============
97
- Dependent package Extra
98
- ============================================================================================================ ==============
99
- `apache-airflow-providers-common-sql <https://airflow.apache.org/docs/apache-airflow-providers-common-sql>`_ ``common.sql``
100
- ============================================================================================================ ==============
96
+ ================================================================================================================== =================
97
+ Dependent package Extra
98
+ ================================================================================================================== =================
99
+ `apache-airflow-providers-common-compat <https://airflow.apache.org/docs/apache-airflow-providers-common-compat>`_ ``common.compat``
100
+ `apache-airflow-providers-common-sql <https://airflow.apache.org/docs/apache-airflow-providers-common-sql>`_ ``common.sql``
101
+ ================================================================================================================== =================
101
102
 
102
103
  The changelog for the provider package can be found in the
103
- `changelog <https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.12.1/changelog.html>`_.
104
+ `changelog <https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.12.2/changelog.html>`_.
@@ -29,7 +29,7 @@ from airflow import __version__ as airflow_version
29
29
 
30
30
  __all__ = ["__version__"]
31
31
 
32
- __version__ = "1.12.1"
32
+ __version__ = "1.12.2"
33
33
 
34
34
  if packaging.version.parse(packaging.version.parse(airflow_version).base_version) < packaging.version.parse(
35
35
  "2.8.0"
@@ -35,7 +35,7 @@ if os.getenv("PYTEST_VERSION"):
35
35
 
36
36
  cache = decorator
37
37
  else:
38
- from airflow.compat.functools import cache
38
+ from functools import cache
39
39
  from airflow.configuration import conf
40
40
 
41
41
  _CONFIG_SECTION = "openlineage"
@@ -18,6 +18,7 @@ from __future__ import annotations
18
18
 
19
19
  from typing import TYPE_CHECKING, Iterator
20
20
 
21
+ from airflow.providers.common.compat.openlineage.utils.utils import translate_airflow_asset
21
22
  from airflow.providers.openlineage import conf
22
23
  from airflow.providers.openlineage.extractors import BaseExtractor, OperatorLineage
23
24
  from airflow.providers.openlineage.extractors.base import DefaultExtractor
@@ -25,7 +26,6 @@ from airflow.providers.openlineage.extractors.bash import BashExtractor
25
26
  from airflow.providers.openlineage.extractors.python import PythonExtractor
26
27
  from airflow.providers.openlineage.utils.utils import (
27
28
  get_unknown_source_attribute_run_facet,
28
- translate_airflow_dataset,
29
29
  try_import_from_string,
30
30
  )
31
31
  from airflow.utils.log.logging_mixin import LoggingMixin
@@ -178,7 +178,16 @@ class ExtractorManager(LoggingMixin):
178
178
 
179
179
  def get_hook_lineage(self) -> tuple[list[Dataset], list[Dataset]] | None:
180
180
  try:
181
- from airflow.lineage.hook import get_hook_lineage_collector
181
+ from importlib.util import find_spec
182
+
183
+ if find_spec("airflow.assets"):
184
+ from airflow.lineage.hook import get_hook_lineage_collector
185
+ else:
186
+ # TODO: import from common.compat directly after common.compat providers with
187
+ # asset_compat_lineage_collector released
188
+ from airflow.providers.openlineage.utils.asset_compat_lineage_collector import (
189
+ get_hook_lineage_collector,
190
+ )
182
191
  except ImportError:
183
192
  return None
184
193
 
@@ -187,16 +196,14 @@ class ExtractorManager(LoggingMixin):
187
196
 
188
197
  return (
189
198
  [
190
- dataset
191
- for dataset_info in get_hook_lineage_collector().collected_datasets.inputs
192
- if (dataset := translate_airflow_dataset(dataset_info.dataset, dataset_info.context))
193
- is not None
199
+ asset
200
+ for asset_info in get_hook_lineage_collector().collected_assets.inputs
201
+ if (asset := translate_airflow_asset(asset_info.asset, asset_info.context)) is not None
194
202
  ],
195
203
  [
196
- dataset
197
- for dataset_info in get_hook_lineage_collector().collected_datasets.outputs
198
- if (dataset := translate_airflow_dataset(dataset_info.dataset, dataset_info.context))
199
- is not None
204
+ asset
205
+ for asset_info in get_hook_lineage_collector().collected_assets.outputs
206
+ if (asset := translate_airflow_asset(asset_info.asset, asset_info.context)) is not None
200
207
  ],
201
208
  )
202
209
 
@@ -28,8 +28,9 @@ def get_provider_info():
28
28
  "name": "OpenLineage Airflow",
29
29
  "description": "`OpenLineage <https://openlineage.io/>`__\n",
30
30
  "state": "ready",
31
- "source-date-epoch": 1727372276,
31
+ "source-date-epoch": 1728485291,
32
32
  "versions": [
33
+ "1.12.2",
33
34
  "1.12.1",
34
35
  "1.12.0",
35
36
  "1.11.0",
@@ -88,7 +89,7 @@ def get_provider_info():
88
89
  "disabled_for_operators": {
89
90
  "description": "Exclude some Operators from emitting OpenLineage events by passing a string of semicolon separated\nfull import paths of Operators to disable.\n",
90
91
  "type": "string",
91
- "example": "airflow.operators.bash.BashOperator;airflow.operators.python.PythonOperator",
92
+ "example": "airflow.providers.standard.operators.bash.BashOperator; airflow.operators.python.PythonOperator",
92
93
  "default": "",
93
94
  "version_added": "1.1.0",
94
95
  },
@@ -0,0 +1,108 @@
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
+ from __future__ import annotations
18
+
19
+ from importlib.util import find_spec
20
+
21
+ # TODO: replace this module with common.compat provider once common.compat 1.3.0 released
22
+
23
+
24
+ def _get_asset_compat_hook_lineage_collector():
25
+ from airflow.lineage.hook import get_hook_lineage_collector
26
+
27
+ collector = get_hook_lineage_collector()
28
+
29
+ if all(
30
+ getattr(collector, asset_method_name, None)
31
+ for asset_method_name in ("add_input_asset", "add_output_asset", "collected_assets")
32
+ ):
33
+ return collector
34
+
35
+ # dataset is renamed as asset in Airflow 3.0
36
+
37
+ from functools import wraps
38
+
39
+ from airflow.lineage.hook import DatasetLineageInfo, HookLineage
40
+
41
+ DatasetLineageInfo.asset = DatasetLineageInfo.dataset
42
+
43
+ def rename_dataset_kwargs_as_assets_kwargs(function):
44
+ @wraps(function)
45
+ def wrapper(*args, **kwargs):
46
+ if "asset_kwargs" in kwargs:
47
+ kwargs["dataset_kwargs"] = kwargs.pop("asset_kwargs")
48
+
49
+ if "asset_extra" in kwargs:
50
+ kwargs["dataset_extra"] = kwargs.pop("asset_extra")
51
+
52
+ return function(*args, **kwargs)
53
+
54
+ return wrapper
55
+
56
+ collector.create_asset = rename_dataset_kwargs_as_assets_kwargs(collector.create_dataset)
57
+ collector.add_input_asset = rename_dataset_kwargs_as_assets_kwargs(collector.add_input_dataset)
58
+ collector.add_output_asset = rename_dataset_kwargs_as_assets_kwargs(collector.add_output_dataset)
59
+
60
+ def collected_assets_compat(collector) -> HookLineage:
61
+ """Get the collected hook lineage information."""
62
+ lineage = collector.collected_datasets
63
+ return HookLineage(
64
+ [
65
+ DatasetLineageInfo(dataset=item.dataset, count=item.count, context=item.context)
66
+ for item in lineage.inputs
67
+ ],
68
+ [
69
+ DatasetLineageInfo(dataset=item.dataset, count=item.count, context=item.context)
70
+ for item in lineage.outputs
71
+ ],
72
+ )
73
+
74
+ setattr(
75
+ collector.__class__,
76
+ "collected_assets",
77
+ property(lambda collector: collected_assets_compat(collector)),
78
+ )
79
+
80
+ return collector
81
+
82
+
83
+ def get_hook_lineage_collector():
84
+ # HookLineageCollector added in 2.10
85
+ try:
86
+ if find_spec("airflow.assets"):
87
+ # Dataset has been renamed as Asset in 3.0
88
+ from airflow.lineage.hook import get_hook_lineage_collector
89
+
90
+ return get_hook_lineage_collector()
91
+
92
+ return _get_asset_compat_hook_lineage_collector()
93
+ except ImportError:
94
+
95
+ class NoOpCollector:
96
+ """
97
+ NoOpCollector is a hook lineage collector that does nothing.
98
+
99
+ It is used when you want to disable lineage collection.
100
+ """
101
+
102
+ def add_input_asset(self, *_, **__):
103
+ pass
104
+
105
+ def add_output_asset(self, *_, **__):
106
+ pass
107
+
108
+ return NoOpCollector()
@@ -31,7 +31,6 @@ from openlineage.client.utils import RedactMixin
31
31
  from packaging.version import Version
32
32
 
33
33
  from airflow import __version__ as AIRFLOW_VERSION
34
- from airflow.datasets import Dataset
35
34
  from airflow.exceptions import AirflowProviderDeprecationWarning # TODO: move this maybe to Airflow's logic?
36
35
  from airflow.models import DAG, BaseOperator, DagRun, MappedOperator
37
36
  from airflow.providers.openlineage import conf
@@ -54,6 +53,11 @@ from airflow.utils.context import AirflowContextDeprecationWarning
54
53
  from airflow.utils.log.secrets_masker import Redactable, Redacted, SecretsMasker, should_hide_value_for_key
55
54
  from airflow.utils.module_loading import import_string
56
55
 
56
+ try:
57
+ from airflow.assets import Asset
58
+ except ModuleNotFoundError:
59
+ from airflow.datasets import Dataset as Asset # type: ignore[no-redef]
60
+
57
61
  if TYPE_CHECKING:
58
62
  from openlineage.client.event_v2 import Dataset as OpenLineageDataset
59
63
  from openlineage.client.facet_v2 import RunFacet
@@ -283,8 +287,8 @@ class TaskInstanceInfo(InfoJsonEncodable):
283
287
  }
284
288
 
285
289
 
286
- class DatasetInfo(InfoJsonEncodable):
287
- """Defines encoding Airflow Dataset object to JSON."""
290
+ class AssetInfo(InfoJsonEncodable):
291
+ """Defines encoding Airflow Asset object to JSON."""
288
292
 
289
293
  includes = ["uri", "extra"]
290
294
 
@@ -335,8 +339,8 @@ class TaskInfo(InfoJsonEncodable):
335
339
  if hasattr(task, "task_group") and getattr(task.task_group, "_group_id", None)
336
340
  else None
337
341
  ),
338
- "inlets": lambda task: [DatasetInfo(i) for i in task.inlets if isinstance(i, Dataset)],
339
- "outlets": lambda task: [DatasetInfo(o) for o in task.outlets if isinstance(o, Dataset)],
342
+ "inlets": lambda task: [AssetInfo(i) for i in task.inlets if isinstance(i, Asset)],
343
+ "outlets": lambda task: [AssetInfo(o) for o in task.outlets if isinstance(o, Asset)],
340
344
  }
341
345
 
342
346
 
@@ -641,19 +645,29 @@ def should_use_external_connection(hook) -> bool:
641
645
  return True
642
646
 
643
647
 
644
- def translate_airflow_dataset(dataset: Dataset, lineage_context) -> OpenLineageDataset | None:
648
+ def translate_airflow_asset(asset: Asset, lineage_context) -> OpenLineageDataset | None:
645
649
  """
646
- Convert a Dataset with an AIP-60 compliant URI to an OpenLineageDataset.
650
+ Convert a Asset with an AIP-60 compliant URI to an OpenLineageDataset.
647
651
 
648
- This function returns None if no URI normalizer is defined, no dataset converter is found or
652
+ This function returns None if no URI normalizer is defined, no asset converter is found or
649
653
  some core Airflow changes are missing and ImportError is raised.
650
654
  """
651
655
  try:
652
- from airflow.datasets import _get_normalized_scheme
656
+ from airflow.assets import _get_normalized_scheme
657
+ except ModuleNotFoundError:
658
+ try:
659
+ from airflow.datasets import _get_normalized_scheme # type: ignore[no-redef]
660
+ except ImportError:
661
+ return None
662
+
663
+ try:
653
664
  from airflow.providers_manager import ProvidersManager
654
665
 
655
- ol_converters = ProvidersManager().dataset_to_openlineage_converters
656
- normalized_uri = dataset.normalized_uri
666
+ ol_converters = getattr(ProvidersManager(), "asset_to_openlineage_converters", None)
667
+ if not ol_converters:
668
+ ol_converters = ProvidersManager().dataset_to_openlineage_converters # type: ignore[attr-defined]
669
+
670
+ normalized_uri = asset.normalized_uri
657
671
  except (ImportError, AttributeError):
658
672
  return None
659
673
 
@@ -666,4 +680,4 @@ def translate_airflow_dataset(dataset: Dataset, lineage_context) -> OpenLineageD
666
680
  if (airflow_to_ol_converter := ol_converters.get(normalized_scheme)) is None:
667
681
  return None
668
682
 
669
- return airflow_to_ol_converter(Dataset(uri=normalized_uri, extra=dataset.extra), lineage_context)
683
+ return airflow_to_ol_converter(Asset(uri=normalized_uri, extra=asset.extra), lineage_context)
@@ -28,7 +28,7 @@ build-backend = "flit_core.buildapi"
28
28
 
29
29
  [project]
30
30
  name = "apache-airflow-providers-openlineage"
31
- version = "1.12.1"
31
+ version = "1.12.2"
32
32
  description = "Provider package apache-airflow-providers-openlineage for Apache Airflow"
33
33
  readme = "README.rst"
34
34
  authors = [
@@ -47,14 +47,13 @@ classifiers = [
47
47
  "Framework :: Apache Airflow",
48
48
  "Framework :: Apache Airflow :: Provider",
49
49
  "License :: OSI Approved :: Apache Software License",
50
- "Programming Language :: Python :: 3.8",
51
50
  "Programming Language :: Python :: 3.9",
52
51
  "Programming Language :: Python :: 3.10",
53
52
  "Programming Language :: Python :: 3.11",
54
53
  "Programming Language :: Python :: 3.12",
55
54
  "Topic :: System :: Monitoring",
56
55
  ]
57
- requires-python = "~=3.8"
56
+ requires-python = "~=3.9"
58
57
  dependencies = [
59
58
  "apache-airflow-providers-common-compat>=1.2.0",
60
59
  "apache-airflow-providers-common-sql>=1.6.0",
@@ -65,8 +64,8 @@ dependencies = [
65
64
  ]
66
65
 
67
66
  [project.urls]
68
- "Documentation" = "https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.12.1"
69
- "Changelog" = "https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.12.1/changelog.html"
67
+ "Documentation" = "https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.12.2"
68
+ "Changelog" = "https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.12.2/changelog.html"
70
69
  "Bug Tracker" = "https://github.com/apache/airflow/issues"
71
70
  "Source Code" = "https://github.com/apache/airflow"
72
71
  "Slack Chat" = "https://s.apache.org/airflow-slack"
@@ -78,6 +77,9 @@ provider_info = "airflow.providers.openlineage.get_provider_info:get_provider_in
78
77
  [project.entry-points."airflow.plugins"]
79
78
  openlineage = "airflow.providers.openlineage.plugins.openlineage:OpenLineageProviderPlugin"
80
79
  [project.optional-dependencies]
80
+ "common.compat" = [
81
+ "apache-airflow-providers-common-compat",
82
+ ]
81
83
  "common.sql" = [
82
84
  "apache-airflow-providers-common-sql",
83
85
  ]