apache-airflow-providers-openlineage 1.7.0rc1__tar.gz → 1.7.1rc1__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.
- {apache_airflow_providers_openlineage-1.7.0rc1 → apache_airflow_providers_openlineage-1.7.1rc1}/PKG-INFO +6 -6
- {apache_airflow_providers_openlineage-1.7.0rc1 → apache_airflow_providers_openlineage-1.7.1rc1}/README.rst +3 -3
- {apache_airflow_providers_openlineage-1.7.0rc1 → apache_airflow_providers_openlineage-1.7.1rc1}/airflow/providers/openlineage/__init__.py +1 -1
- {apache_airflow_providers_openlineage-1.7.0rc1 → apache_airflow_providers_openlineage-1.7.1rc1}/airflow/providers/openlineage/get_provider_info.py +2 -1
- {apache_airflow_providers_openlineage-1.7.0rc1 → apache_airflow_providers_openlineage-1.7.1rc1}/airflow/providers/openlineage/sqlparser.py +50 -11
- {apache_airflow_providers_openlineage-1.7.0rc1 → apache_airflow_providers_openlineage-1.7.1rc1}/airflow/providers/openlineage/utils/utils.py +5 -0
- {apache_airflow_providers_openlineage-1.7.0rc1 → apache_airflow_providers_openlineage-1.7.1rc1}/pyproject.toml +3 -3
- {apache_airflow_providers_openlineage-1.7.0rc1 → apache_airflow_providers_openlineage-1.7.1rc1}/airflow/providers/openlineage/LICENSE +0 -0
- {apache_airflow_providers_openlineage-1.7.0rc1 → apache_airflow_providers_openlineage-1.7.1rc1}/airflow/providers/openlineage/conf.py +0 -0
- {apache_airflow_providers_openlineage-1.7.0rc1 → apache_airflow_providers_openlineage-1.7.1rc1}/airflow/providers/openlineage/extractors/__init__.py +0 -0
- {apache_airflow_providers_openlineage-1.7.0rc1 → apache_airflow_providers_openlineage-1.7.1rc1}/airflow/providers/openlineage/extractors/base.py +0 -0
- {apache_airflow_providers_openlineage-1.7.0rc1 → apache_airflow_providers_openlineage-1.7.1rc1}/airflow/providers/openlineage/extractors/bash.py +0 -0
- {apache_airflow_providers_openlineage-1.7.0rc1 → apache_airflow_providers_openlineage-1.7.1rc1}/airflow/providers/openlineage/extractors/manager.py +0 -0
- {apache_airflow_providers_openlineage-1.7.0rc1 → apache_airflow_providers_openlineage-1.7.1rc1}/airflow/providers/openlineage/extractors/python.py +0 -0
- {apache_airflow_providers_openlineage-1.7.0rc1 → apache_airflow_providers_openlineage-1.7.1rc1}/airflow/providers/openlineage/plugins/__init__.py +0 -0
- {apache_airflow_providers_openlineage-1.7.0rc1 → apache_airflow_providers_openlineage-1.7.1rc1}/airflow/providers/openlineage/plugins/adapter.py +0 -0
- {apache_airflow_providers_openlineage-1.7.0rc1 → apache_airflow_providers_openlineage-1.7.1rc1}/airflow/providers/openlineage/plugins/facets.py +0 -0
- {apache_airflow_providers_openlineage-1.7.0rc1 → apache_airflow_providers_openlineage-1.7.1rc1}/airflow/providers/openlineage/plugins/listener.py +0 -0
- {apache_airflow_providers_openlineage-1.7.0rc1 → apache_airflow_providers_openlineage-1.7.1rc1}/airflow/providers/openlineage/plugins/macros.py +0 -0
- {apache_airflow_providers_openlineage-1.7.0rc1 → apache_airflow_providers_openlineage-1.7.1rc1}/airflow/providers/openlineage/plugins/openlineage.py +0 -0
- {apache_airflow_providers_openlineage-1.7.0rc1 → apache_airflow_providers_openlineage-1.7.1rc1}/airflow/providers/openlineage/utils/__init__.py +0 -0
- {apache_airflow_providers_openlineage-1.7.0rc1 → apache_airflow_providers_openlineage-1.7.1rc1}/airflow/providers/openlineage/utils/selective_enable.py +0 -0
- {apache_airflow_providers_openlineage-1.7.0rc1 → apache_airflow_providers_openlineage-1.7.1rc1}/airflow/providers/openlineage/utils/sql.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: apache-airflow-providers-openlineage
|
|
3
|
-
Version: 1.7.
|
|
3
|
+
Version: 1.7.1rc1
|
|
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>
|
|
@@ -28,8 +28,8 @@ Requires-Dist: openlineage-integration-common>=0.28.0
|
|
|
28
28
|
Requires-Dist: openlineage-python>=0.28.0
|
|
29
29
|
Requires-Dist: apache-airflow-providers-common-sql ; extra == "common.sql"
|
|
30
30
|
Project-URL: Bug Tracker, https://github.com/apache/airflow/issues
|
|
31
|
-
Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.7.
|
|
32
|
-
Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.7.
|
|
31
|
+
Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.7.1/changelog.html
|
|
32
|
+
Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.7.1
|
|
33
33
|
Project-URL: Slack Chat, https://s.apache.org/airflow-slack
|
|
34
34
|
Project-URL: Source Code, https://github.com/apache/airflow
|
|
35
35
|
Project-URL: Twitter, https://twitter.com/ApacheAirflow
|
|
@@ -80,7 +80,7 @@ Provides-Extra: common.sql
|
|
|
80
80
|
|
|
81
81
|
Package ``apache-airflow-providers-openlineage``
|
|
82
82
|
|
|
83
|
-
Release: ``1.7.
|
|
83
|
+
Release: ``1.7.1.rc1``
|
|
84
84
|
|
|
85
85
|
|
|
86
86
|
`OpenLineage <https://openlineage.io/>`__
|
|
@@ -93,7 +93,7 @@ This is a provider package for ``openlineage`` provider. All classes for this pr
|
|
|
93
93
|
are in ``airflow.providers.openlineage`` python package.
|
|
94
94
|
|
|
95
95
|
You can find package information and changelog for the provider
|
|
96
|
-
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.7.
|
|
96
|
+
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.7.1/>`_.
|
|
97
97
|
|
|
98
98
|
Installation
|
|
99
99
|
------------
|
|
@@ -137,4 +137,4 @@ Dependent package
|
|
|
137
137
|
============================================================================================================ ==============
|
|
138
138
|
|
|
139
139
|
The changelog for the provider package can be found in the
|
|
140
|
-
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.7.
|
|
140
|
+
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.7.1/changelog.html>`_.
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
|
|
43
43
|
Package ``apache-airflow-providers-openlineage``
|
|
44
44
|
|
|
45
|
-
Release: ``1.7.
|
|
45
|
+
Release: ``1.7.1.rc1``
|
|
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.7.
|
|
58
|
+
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.7.1/>`_.
|
|
59
59
|
|
|
60
60
|
Installation
|
|
61
61
|
------------
|
|
@@ -99,4 +99,4 @@ Dependent package
|
|
|
99
99
|
============================================================================================================ ==============
|
|
100
100
|
|
|
101
101
|
The changelog for the provider package can be found in the
|
|
102
|
-
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.7.
|
|
102
|
+
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.7.1/changelog.html>`_.
|
|
@@ -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":
|
|
31
|
+
"source-date-epoch": 1714477058,
|
|
32
32
|
"versions": [
|
|
33
|
+
"1.7.1",
|
|
33
34
|
"1.7.0",
|
|
34
35
|
"1.6.0",
|
|
35
36
|
"1.5.0",
|
|
@@ -29,6 +29,7 @@ from openlineage.client.facet import (
|
|
|
29
29
|
ExtractionErrorRunFacet,
|
|
30
30
|
SqlJobFacet,
|
|
31
31
|
)
|
|
32
|
+
from openlineage.client.run import Dataset
|
|
32
33
|
from openlineage.common.sql import DbTableMeta, SqlMeta, parse
|
|
33
34
|
|
|
34
35
|
from airflow.providers.openlineage.extractors.base import OperatorLineage
|
|
@@ -40,7 +41,6 @@ from airflow.providers.openlineage.utils.sql import (
|
|
|
40
41
|
from airflow.typing_compat import TypedDict
|
|
41
42
|
|
|
42
43
|
if TYPE_CHECKING:
|
|
43
|
-
from openlineage.client.run import Dataset
|
|
44
44
|
from sqlalchemy.engine import Engine
|
|
45
45
|
|
|
46
46
|
from airflow.hooks.base import BaseHook
|
|
@@ -104,6 +104,18 @@ class DatabaseInfo:
|
|
|
104
104
|
normalize_name_method: Callable[[str], str] = default_normalize_name_method
|
|
105
105
|
|
|
106
106
|
|
|
107
|
+
def from_table_meta(
|
|
108
|
+
table_meta: DbTableMeta, database: str | None, namespace: str, is_uppercase: bool
|
|
109
|
+
) -> Dataset:
|
|
110
|
+
if table_meta.database:
|
|
111
|
+
name = table_meta.qualified_name
|
|
112
|
+
elif database:
|
|
113
|
+
name = f"{database}.{table_meta.schema}.{table_meta.name}"
|
|
114
|
+
else:
|
|
115
|
+
name = f"{table_meta.schema}.{table_meta.name}"
|
|
116
|
+
return Dataset(namespace=namespace, name=name if not is_uppercase else name.upper())
|
|
117
|
+
|
|
118
|
+
|
|
107
119
|
class SQLParser:
|
|
108
120
|
"""Interface for openlineage-sql.
|
|
109
121
|
|
|
@@ -117,7 +129,7 @@ class SQLParser:
|
|
|
117
129
|
|
|
118
130
|
def parse(self, sql: list[str] | str) -> SqlMeta | None:
|
|
119
131
|
"""Parse a single or a list of SQL statements."""
|
|
120
|
-
return parse(sql=sql, dialect=self.dialect)
|
|
132
|
+
return parse(sql=sql, dialect=self.dialect, default_schema=self.default_schema)
|
|
121
133
|
|
|
122
134
|
def parse_table_schemas(
|
|
123
135
|
self,
|
|
@@ -156,6 +168,23 @@ class SQLParser:
|
|
|
156
168
|
else None,
|
|
157
169
|
)
|
|
158
170
|
|
|
171
|
+
def get_metadata_from_parser(
|
|
172
|
+
self,
|
|
173
|
+
inputs: list[DbTableMeta],
|
|
174
|
+
outputs: list[DbTableMeta],
|
|
175
|
+
database_info: DatabaseInfo,
|
|
176
|
+
namespace: str = DEFAULT_NAMESPACE,
|
|
177
|
+
database: str | None = None,
|
|
178
|
+
) -> tuple[list[Dataset], ...]:
|
|
179
|
+
database = database if database else database_info.database
|
|
180
|
+
return [
|
|
181
|
+
from_table_meta(dataset, database, namespace, database_info.is_uppercase_names)
|
|
182
|
+
for dataset in inputs
|
|
183
|
+
], [
|
|
184
|
+
from_table_meta(dataset, database, namespace, database_info.is_uppercase_names)
|
|
185
|
+
for dataset in outputs
|
|
186
|
+
]
|
|
187
|
+
|
|
159
188
|
def attach_column_lineage(
|
|
160
189
|
self, datasets: list[Dataset], database: str | None, parse_result: SqlMeta
|
|
161
190
|
) -> None:
|
|
@@ -204,6 +233,7 @@ class SQLParser:
|
|
|
204
233
|
database_info: DatabaseInfo,
|
|
205
234
|
database: str | None = None,
|
|
206
235
|
sqlalchemy_engine: Engine | None = None,
|
|
236
|
+
use_connection: bool = True,
|
|
207
237
|
) -> OperatorLineage:
|
|
208
238
|
"""Parse SQL statement(s) and generate OpenLineage metadata.
|
|
209
239
|
|
|
@@ -242,15 +272,24 @@ class SQLParser:
|
|
|
242
272
|
)
|
|
243
273
|
|
|
244
274
|
namespace = self.create_namespace(database_info=database_info)
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
275
|
+
if use_connection:
|
|
276
|
+
inputs, outputs = self.parse_table_schemas(
|
|
277
|
+
hook=hook,
|
|
278
|
+
inputs=parse_result.in_tables,
|
|
279
|
+
outputs=parse_result.out_tables,
|
|
280
|
+
namespace=namespace,
|
|
281
|
+
database=database,
|
|
282
|
+
database_info=database_info,
|
|
283
|
+
sqlalchemy_engine=sqlalchemy_engine,
|
|
284
|
+
)
|
|
285
|
+
else:
|
|
286
|
+
inputs, outputs = self.get_metadata_from_parser(
|
|
287
|
+
inputs=parse_result.in_tables,
|
|
288
|
+
outputs=parse_result.out_tables,
|
|
289
|
+
namespace=namespace,
|
|
290
|
+
database=database,
|
|
291
|
+
database_info=database_info,
|
|
292
|
+
)
|
|
254
293
|
|
|
255
294
|
self.attach_column_lineage(outputs, database or database_info.database, parse_result)
|
|
256
295
|
|
|
@@ -384,3 +384,8 @@ def normalize_sql(sql: str | Iterable[str]):
|
|
|
384
384
|
sql = [stmt for stmt in sql.split(";") if stmt != ""]
|
|
385
385
|
sql = [obj for stmt in sql for obj in stmt.split(";") if obj != ""]
|
|
386
386
|
return ";\n".join(sql)
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
def should_use_external_connection(hook) -> bool:
|
|
390
|
+
# TODO: Add checking overrides
|
|
391
|
+
return hook.__class__.__name__ not in ["SnowflakeHook", "SnowflakeSqlApiHook"]
|
|
@@ -28,7 +28,7 @@ build-backend = "flit_core.buildapi"
|
|
|
28
28
|
|
|
29
29
|
[project]
|
|
30
30
|
name = "apache-airflow-providers-openlineage"
|
|
31
|
-
version = "1.7.
|
|
31
|
+
version = "1.7.1.rc1"
|
|
32
32
|
description = "Provider package apache-airflow-providers-openlineage for Apache Airflow"
|
|
33
33
|
readme = "README.rst"
|
|
34
34
|
authors = [
|
|
@@ -64,8 +64,8 @@ dependencies = [
|
|
|
64
64
|
]
|
|
65
65
|
|
|
66
66
|
[project.urls]
|
|
67
|
-
"Documentation" = "https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.7.
|
|
68
|
-
"Changelog" = "https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.7.
|
|
67
|
+
"Documentation" = "https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.7.1"
|
|
68
|
+
"Changelog" = "https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.7.1/changelog.html"
|
|
69
69
|
"Bug Tracker" = "https://github.com/apache/airflow/issues"
|
|
70
70
|
"Source Code" = "https://github.com/apache/airflow"
|
|
71
71
|
"Slack Chat" = "https://s.apache.org/airflow-slack"
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|