apache-airflow-providers-openlineage 1.1.1rc1__py3-none-any.whl → 1.2.0rc1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of apache-airflow-providers-openlineage might be problematic. Click here for more details.
- airflow/providers/openlineage/__init__.py +2 -2
- airflow/providers/openlineage/get_provider_info.py +1 -1
- airflow/providers/openlineage/sqlparser.py +52 -1
- {apache_airflow_providers_openlineage-1.1.1rc1.dist-info → apache_airflow_providers_openlineage-1.2.0rc1.dist-info}/METADATA +6 -6
- {apache_airflow_providers_openlineage-1.1.1rc1.dist-info → apache_airflow_providers_openlineage-1.2.0rc1.dist-info}/RECORD +10 -10
- {apache_airflow_providers_openlineage-1.1.1rc1.dist-info → apache_airflow_providers_openlineage-1.2.0rc1.dist-info}/LICENSE +0 -0
- {apache_airflow_providers_openlineage-1.1.1rc1.dist-info → apache_airflow_providers_openlineage-1.2.0rc1.dist-info}/NOTICE +0 -0
- {apache_airflow_providers_openlineage-1.1.1rc1.dist-info → apache_airflow_providers_openlineage-1.2.0rc1.dist-info}/WHEEL +0 -0
- {apache_airflow_providers_openlineage-1.1.1rc1.dist-info → apache_airflow_providers_openlineage-1.2.0rc1.dist-info}/entry_points.txt +0 -0
- {apache_airflow_providers_openlineage-1.1.1rc1.dist-info → apache_airflow_providers_openlineage-1.2.0rc1.dist-info}/top_level.txt +0 -0
|
@@ -28,7 +28,7 @@ import packaging.version
|
|
|
28
28
|
|
|
29
29
|
__all__ = ["__version__"]
|
|
30
30
|
|
|
31
|
-
__version__ = "1.
|
|
31
|
+
__version__ = "1.2.0"
|
|
32
32
|
|
|
33
33
|
try:
|
|
34
34
|
from airflow import __version__ as airflow_version
|
|
@@ -39,5 +39,5 @@ if packaging.version.parse(packaging.version.parse(airflow_version).base_version
|
|
|
39
39
|
"2.7.0"
|
|
40
40
|
):
|
|
41
41
|
raise RuntimeError(
|
|
42
|
-
f"The package `apache-airflow-providers-openlineage:{__version__}` requires Apache Airflow 2.7.0+"
|
|
42
|
+
f"The package `apache-airflow-providers-openlineage:{__version__}` requires Apache Airflow 2.7.0+"
|
|
43
43
|
)
|
|
@@ -28,7 +28,7 @@ def get_provider_info():
|
|
|
28
28
|
"name": "OpenLineage Airflow",
|
|
29
29
|
"description": "`OpenLineage <https://openlineage.io/>`__\n",
|
|
30
30
|
"suspended": False,
|
|
31
|
-
"versions": ["1.1.1", "1.1.0", "1.0.2", "1.0.1", "1.0.0"],
|
|
31
|
+
"versions": ["1.2.0", "1.1.1", "1.1.0", "1.0.2", "1.0.1", "1.0.0"],
|
|
32
32
|
"dependencies": [
|
|
33
33
|
"apache-airflow>=2.7.0",
|
|
34
34
|
"apache-airflow-providers-common-sql>=1.6.0",
|
|
@@ -20,7 +20,15 @@ from typing import TYPE_CHECKING, Callable
|
|
|
20
20
|
|
|
21
21
|
import sqlparse
|
|
22
22
|
from attrs import define
|
|
23
|
-
from openlineage.client.facet import
|
|
23
|
+
from openlineage.client.facet import (
|
|
24
|
+
BaseFacet,
|
|
25
|
+
ColumnLineageDatasetFacet,
|
|
26
|
+
ColumnLineageDatasetFacetFieldsAdditional,
|
|
27
|
+
ColumnLineageDatasetFacetFieldsAdditionalInputFields,
|
|
28
|
+
ExtractionError,
|
|
29
|
+
ExtractionErrorRunFacet,
|
|
30
|
+
SqlJobFacet,
|
|
31
|
+
)
|
|
24
32
|
from openlineage.common.sql import DbTableMeta, SqlMeta, parse
|
|
25
33
|
|
|
26
34
|
from airflow.providers.openlineage.extractors.base import OperatorLineage
|
|
@@ -143,6 +151,47 @@ class SQLParser:
|
|
|
143
151
|
else None,
|
|
144
152
|
)
|
|
145
153
|
|
|
154
|
+
def attach_column_lineage(
|
|
155
|
+
self, datasets: list[Dataset], database: str | None, parse_result: SqlMeta
|
|
156
|
+
) -> None:
|
|
157
|
+
"""
|
|
158
|
+
Attaches column lineage facet to the list of datasets.
|
|
159
|
+
|
|
160
|
+
Note that currently each dataset has the same column lineage information set.
|
|
161
|
+
This would be a matter of change after OpenLineage SQL Parser improvements.
|
|
162
|
+
"""
|
|
163
|
+
if not len(parse_result.column_lineage):
|
|
164
|
+
return
|
|
165
|
+
for dataset in datasets:
|
|
166
|
+
dataset.facets["columnLineage"] = ColumnLineageDatasetFacet(
|
|
167
|
+
fields={
|
|
168
|
+
column_lineage.descendant.name: ColumnLineageDatasetFacetFieldsAdditional(
|
|
169
|
+
inputFields=[
|
|
170
|
+
ColumnLineageDatasetFacetFieldsAdditionalInputFields(
|
|
171
|
+
namespace=dataset.namespace,
|
|
172
|
+
name=".".join(
|
|
173
|
+
filter(
|
|
174
|
+
None,
|
|
175
|
+
(
|
|
176
|
+
column_meta.origin.database or database,
|
|
177
|
+
column_meta.origin.schema or self.default_schema,
|
|
178
|
+
column_meta.origin.name,
|
|
179
|
+
),
|
|
180
|
+
)
|
|
181
|
+
)
|
|
182
|
+
if column_meta.origin
|
|
183
|
+
else "",
|
|
184
|
+
field=column_meta.name,
|
|
185
|
+
)
|
|
186
|
+
for column_meta in column_lineage.lineage
|
|
187
|
+
],
|
|
188
|
+
transformationType="",
|
|
189
|
+
transformationDescription="",
|
|
190
|
+
)
|
|
191
|
+
for column_lineage in parse_result.column_lineage
|
|
192
|
+
}
|
|
193
|
+
)
|
|
194
|
+
|
|
146
195
|
def generate_openlineage_metadata_from_sql(
|
|
147
196
|
self,
|
|
148
197
|
sql: list[str] | str,
|
|
@@ -198,6 +247,8 @@ class SQLParser:
|
|
|
198
247
|
sqlalchemy_engine=sqlalchemy_engine,
|
|
199
248
|
)
|
|
200
249
|
|
|
250
|
+
self.attach_column_lineage(outputs, database or database_info.database, parse_result)
|
|
251
|
+
|
|
201
252
|
return OperatorLineage(
|
|
202
253
|
inputs=inputs,
|
|
203
254
|
outputs=outputs,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: apache-airflow-providers-openlineage
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2.0rc1
|
|
4
4
|
Summary: Provider for Apache Airflow. Implements apache-airflow-providers-openlineage package
|
|
5
5
|
Home-page: https://airflow.apache.org/
|
|
6
6
|
Download-URL: https://archive.apache.org/dist/airflow/providers
|
|
7
7
|
Author: Apache Software Foundation
|
|
8
8
|
Author-email: dev@airflow.apache.org
|
|
9
9
|
License: Apache License 2.0
|
|
10
|
-
Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.
|
|
11
|
-
Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.
|
|
10
|
+
Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.2.0/
|
|
11
|
+
Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.2.0/changelog.html
|
|
12
12
|
Project-URL: Bug Tracker, https://github.com/apache/airflow/issues
|
|
13
13
|
Project-URL: Source Code, https://github.com/apache/airflow
|
|
14
14
|
Project-URL: Slack Chat, https://s.apache.org/airflow-slack
|
|
@@ -77,7 +77,7 @@ Requires-Dist: apache-airflow-providers-common-sql ; extra == 'common.sql'
|
|
|
77
77
|
|
|
78
78
|
Package ``apache-airflow-providers-openlineage``
|
|
79
79
|
|
|
80
|
-
Release: ``1.
|
|
80
|
+
Release: ``1.2.0rc1``
|
|
81
81
|
|
|
82
82
|
|
|
83
83
|
`OpenLineage <https://openlineage.io/>`__
|
|
@@ -90,7 +90,7 @@ This is a provider package for ``openlineage`` provider. All classes for this pr
|
|
|
90
90
|
are in ``airflow.providers.openlineage`` 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-openlineage/1.
|
|
93
|
+
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.2.0/>`_.
|
|
94
94
|
|
|
95
95
|
|
|
96
96
|
Installation
|
|
@@ -135,4 +135,4 @@ Dependent package
|
|
|
135
135
|
============================================================================================================ ==============
|
|
136
136
|
|
|
137
137
|
The changelog for the provider package can be found in the
|
|
138
|
-
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.
|
|
138
|
+
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.2.0/changelog.html>`_.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
airflow/providers/openlineage/__init__.py,sha256=
|
|
2
|
-
airflow/providers/openlineage/get_provider_info.py,sha256=
|
|
3
|
-
airflow/providers/openlineage/sqlparser.py,sha256=
|
|
1
|
+
airflow/providers/openlineage/__init__.py,sha256=UpJTT3Z9ty4-WI1TSkpF-mEgn6IU9QD4c-XQb1fV38s,1566
|
|
2
|
+
airflow/providers/openlineage/get_provider_info.py,sha256=n5q_og3hQt8DjbyNn2t7YX-QzJmTglrEiikFMp8icfE,5314
|
|
3
|
+
airflow/providers/openlineage/sqlparser.py,sha256=cB2NFH9rPUnkHqZ4NGh7AsAnoR7Y0YeEtQN9kgMTtRg,13384
|
|
4
4
|
airflow/providers/openlineage/extractors/__init__.py,sha256=I0X4f6zUniclyD9zT0DFHRImpCpJVP4MkPJT3cd7X5I,1081
|
|
5
5
|
airflow/providers/openlineage/extractors/base.py,sha256=KUYdZa8B238BISeaKLPNghaAt4AGGGkC-ufzsI4FB5w,5897
|
|
6
6
|
airflow/providers/openlineage/extractors/bash.py,sha256=fz1nVywzk1kUsZWeEbQ8zV6osTGhmd_pLgAKoJla54g,2843
|
|
@@ -15,10 +15,10 @@ airflow/providers/openlineage/plugins/openlineage.py,sha256=XiEznOts-q9Uq08rkorc
|
|
|
15
15
|
airflow/providers/openlineage/utils/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
|
16
16
|
airflow/providers/openlineage/utils/sql.py,sha256=c0X_xZQ_e33su_ZMe_L-Fl_woNUYSHbxWLbRQD9M75k,7567
|
|
17
17
|
airflow/providers/openlineage/utils/utils.py,sha256=tDrU2hWLXzgNvgkNflhMvrf3_CmnlAXCJpukmuVjv80,14256
|
|
18
|
-
apache_airflow_providers_openlineage-1.
|
|
19
|
-
apache_airflow_providers_openlineage-1.
|
|
20
|
-
apache_airflow_providers_openlineage-1.
|
|
21
|
-
apache_airflow_providers_openlineage-1.
|
|
22
|
-
apache_airflow_providers_openlineage-1.
|
|
23
|
-
apache_airflow_providers_openlineage-1.
|
|
24
|
-
apache_airflow_providers_openlineage-1.
|
|
18
|
+
apache_airflow_providers_openlineage-1.2.0rc1.dist-info/LICENSE,sha256=gXPVwptPlW1TJ4HSuG5OMPg-a3h43OGMkZRR1rpwfJA,10850
|
|
19
|
+
apache_airflow_providers_openlineage-1.2.0rc1.dist-info/METADATA,sha256=9kGNQD7awo5w9qzAmsnU83QU0JR15leNMZfiT1Ba1Mc,6114
|
|
20
|
+
apache_airflow_providers_openlineage-1.2.0rc1.dist-info/NOTICE,sha256=m-6s2XynUxVSUIxO4rVablAZCvFq-wmLrqV91DotRBw,240
|
|
21
|
+
apache_airflow_providers_openlineage-1.2.0rc1.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
|
22
|
+
apache_airflow_providers_openlineage-1.2.0rc1.dist-info/entry_points.txt,sha256=o3u5CDyGe9EFZZUzNErLIHC3iLPojedbWlqOBMiCNCI,217
|
|
23
|
+
apache_airflow_providers_openlineage-1.2.0rc1.dist-info/top_level.txt,sha256=OeMVH5md7fr2QQWpnZoOWWxWO-0WH1IP70lpTVwopPg,8
|
|
24
|
+
apache_airflow_providers_openlineage-1.2.0rc1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|