apache-airflow-providers-openlineage 1.0.0__tar.gz → 1.0.1__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.
Files changed (33) hide show
  1. {apache-airflow-providers-openlineage-1.0.0/apache_airflow_providers_openlineage.egg-info → apache-airflow-providers-openlineage-1.0.1}/PKG-INFO +6 -6
  2. {apache-airflow-providers-openlineage-1.0.0 → apache-airflow-providers-openlineage-1.0.1}/README.rst +3 -3
  3. {apache-airflow-providers-openlineage-1.0.0 → apache-airflow-providers-openlineage-1.0.1}/airflow/providers/openlineage/__init__.py +1 -1
  4. {apache-airflow-providers-openlineage-1.0.0 → apache-airflow-providers-openlineage-1.0.1}/airflow/providers/openlineage/extractors/base.py +6 -0
  5. apache-airflow-providers-openlineage-1.0.1/airflow/providers/openlineage/get_provider_info.py +102 -0
  6. {apache-airflow-providers-openlineage-1.0.0 → apache-airflow-providers-openlineage-1.0.1}/airflow/providers/openlineage/plugins/openlineage.py +8 -2
  7. {apache-airflow-providers-openlineage-1.0.0 → apache-airflow-providers-openlineage-1.0.1}/airflow/providers/openlineage/sqlparser.py +1 -1
  8. {apache-airflow-providers-openlineage-1.0.0 → apache-airflow-providers-openlineage-1.0.1}/airflow/providers/openlineage/utils/utils.py +8 -1
  9. {apache-airflow-providers-openlineage-1.0.0 → apache-airflow-providers-openlineage-1.0.1/apache_airflow_providers_openlineage.egg-info}/PKG-INFO +6 -6
  10. {apache-airflow-providers-openlineage-1.0.0 → apache-airflow-providers-openlineage-1.0.1}/pyproject.toml +1 -0
  11. {apache-airflow-providers-openlineage-1.0.0 → apache-airflow-providers-openlineage-1.0.1}/setup.cfg +2 -2
  12. {apache-airflow-providers-openlineage-1.0.0 → apache-airflow-providers-openlineage-1.0.1}/setup.py +1 -1
  13. apache-airflow-providers-openlineage-1.0.0/airflow/providers/openlineage/get_provider_info.py +0 -53
  14. {apache-airflow-providers-openlineage-1.0.0 → apache-airflow-providers-openlineage-1.0.1}/LICENSE +0 -0
  15. {apache-airflow-providers-openlineage-1.0.0 → apache-airflow-providers-openlineage-1.0.1}/MANIFEST.in +0 -0
  16. {apache-airflow-providers-openlineage-1.0.0 → apache-airflow-providers-openlineage-1.0.1}/NOTICE +0 -0
  17. {apache-airflow-providers-openlineage-1.0.0 → apache-airflow-providers-openlineage-1.0.1}/airflow/providers/openlineage/extractors/__init__.py +0 -0
  18. {apache-airflow-providers-openlineage-1.0.0 → apache-airflow-providers-openlineage-1.0.1}/airflow/providers/openlineage/extractors/bash.py +0 -0
  19. {apache-airflow-providers-openlineage-1.0.0 → apache-airflow-providers-openlineage-1.0.1}/airflow/providers/openlineage/extractors/manager.py +0 -0
  20. {apache-airflow-providers-openlineage-1.0.0 → apache-airflow-providers-openlineage-1.0.1}/airflow/providers/openlineage/extractors/python.py +0 -0
  21. {apache-airflow-providers-openlineage-1.0.0 → apache-airflow-providers-openlineage-1.0.1}/airflow/providers/openlineage/plugins/__init__.py +0 -0
  22. {apache-airflow-providers-openlineage-1.0.0 → apache-airflow-providers-openlineage-1.0.1}/airflow/providers/openlineage/plugins/adapter.py +0 -0
  23. {apache-airflow-providers-openlineage-1.0.0 → apache-airflow-providers-openlineage-1.0.1}/airflow/providers/openlineage/plugins/facets.py +0 -0
  24. {apache-airflow-providers-openlineage-1.0.0 → apache-airflow-providers-openlineage-1.0.1}/airflow/providers/openlineage/plugins/listener.py +0 -0
  25. {apache-airflow-providers-openlineage-1.0.0 → apache-airflow-providers-openlineage-1.0.1}/airflow/providers/openlineage/plugins/macros.py +0 -0
  26. {apache-airflow-providers-openlineage-1.0.0 → apache-airflow-providers-openlineage-1.0.1}/airflow/providers/openlineage/utils/__init__.py +0 -0
  27. {apache-airflow-providers-openlineage-1.0.0 → apache-airflow-providers-openlineage-1.0.1}/airflow/providers/openlineage/utils/sql.py +0 -0
  28. {apache-airflow-providers-openlineage-1.0.0 → apache-airflow-providers-openlineage-1.0.1}/apache_airflow_providers_openlineage.egg-info/SOURCES.txt +0 -0
  29. {apache-airflow-providers-openlineage-1.0.0 → apache-airflow-providers-openlineage-1.0.1}/apache_airflow_providers_openlineage.egg-info/dependency_links.txt +0 -0
  30. {apache-airflow-providers-openlineage-1.0.0 → apache-airflow-providers-openlineage-1.0.1}/apache_airflow_providers_openlineage.egg-info/entry_points.txt +0 -0
  31. {apache-airflow-providers-openlineage-1.0.0 → apache-airflow-providers-openlineage-1.0.1}/apache_airflow_providers_openlineage.egg-info/not-zip-safe +0 -0
  32. {apache-airflow-providers-openlineage-1.0.0 → apache-airflow-providers-openlineage-1.0.1}/apache_airflow_providers_openlineage.egg-info/requires.txt +0 -0
  33. {apache-airflow-providers-openlineage-1.0.0 → apache-airflow-providers-openlineage-1.0.1}/apache_airflow_providers_openlineage.egg-info/top_level.txt +0 -0
@@ -1,14 +1,14 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: apache-airflow-providers-openlineage
3
- Version: 1.0.0
3
+ Version: 1.0.1
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.0.0/
11
- Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.0.0/changelog.html
10
+ Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.0.1/
11
+ Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.0.1/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
@@ -71,7 +71,7 @@ License-File: NOTICE
71
71
 
72
72
  Package ``apache-airflow-providers-openlineage``
73
73
 
74
- Release: ``1.0.0``
74
+ Release: ``1.0.1``
75
75
 
76
76
 
77
77
  `OpenLineage <https://openlineage.io/>`__
@@ -84,7 +84,7 @@ This is a provider package for ``openlineage`` provider. All classes for this pr
84
84
  are in ``airflow.providers.openlineage`` python package.
85
85
 
86
86
  You can find package information and changelog for the provider
87
- in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.0.0/>`_.
87
+ in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.0.1/>`_.
88
88
 
89
89
 
90
90
  Installation
@@ -129,4 +129,4 @@ Dependent package
129
129
  ============================================================================================================ ==============
130
130
 
131
131
  The changelog for the provider package can be found in the
132
- `changelog <https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.0.0/changelog.html>`_.
132
+ `changelog <https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.0.1/changelog.html>`_.
@@ -36,7 +36,7 @@
36
36
 
37
37
  Package ``apache-airflow-providers-openlineage``
38
38
 
39
- Release: ``1.0.0``
39
+ Release: ``1.0.1``
40
40
 
41
41
 
42
42
  `OpenLineage <https://openlineage.io/>`__
@@ -49,7 +49,7 @@ This is a provider package for ``openlineage`` provider. All classes for this pr
49
49
  are in ``airflow.providers.openlineage`` python package.
50
50
 
51
51
  You can find package information and changelog for the provider
52
- in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.0.0/>`_.
52
+ in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.0.1/>`_.
53
53
 
54
54
 
55
55
  Installation
@@ -94,4 +94,4 @@ Dependent package
94
94
  ============================================================================================================ ==============
95
95
 
96
96
  The changelog for the provider package can be found in the
97
- `changelog <https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.0.0/changelog.html>`_.
97
+ `changelog <https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.0.1/changelog.html>`_.
@@ -28,7 +28,7 @@ import packaging.version
28
28
 
29
29
  __all__ = ["__version__"]
30
30
 
31
- __version__ = "1.0.0"
31
+ __version__ = "1.0.1"
32
32
 
33
33
  try:
34
34
  from airflow import __version__ as airflow_version
@@ -86,6 +86,12 @@ class DefaultExtractor(BaseExtractor):
86
86
  # OpenLineage methods are optional - if there's no method, return None
87
87
  try:
88
88
  return self._get_openlineage_facets(self.operator.get_openlineage_facets_on_start) # type: ignore
89
+ except ImportError:
90
+ self.log.error(
91
+ "OpenLineage provider method failed to import OpenLineage integration. "
92
+ "This should not happen. Please report this bug to developers."
93
+ )
94
+ return None
89
95
  except AttributeError:
90
96
  return None
91
97
 
@@ -0,0 +1,102 @@
1
+ # Licensed to the Apache Software Foundation (ASF) under one
2
+ # or more contributor license agreements. See the NOTICE file
3
+ # distributed with this work for additional information
4
+ # regarding copyright ownership. The ASF licenses this file
5
+ # to you under the Apache License, Version 2.0 (the
6
+ # "License"); you may not use this file except in compliance
7
+ # with the License. You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
18
+ # NOTE! THIS FILE IS AUTOMATICALLY GENERATED AND WILL BE
19
+ # OVERWRITTEN WHEN PREPARING PACKAGES.
20
+ #
21
+ # IF YOU WANT TO MODIFY IT, YOU SHOULD MODIFY THE TEMPLATE
22
+ # `get_provider_info_TEMPLATE.py.jinja2` IN the `provider_packages` DIRECTORY
23
+
24
+
25
+ def get_provider_info():
26
+ return {
27
+ "package-name": "apache-airflow-providers-openlineage",
28
+ "name": "OpenLineage Airflow",
29
+ "description": "`OpenLineage <https://openlineage.io/>`__\n",
30
+ "suspended": False,
31
+ "versions": ["1.0.1", "1.0.0"],
32
+ "dependencies": [
33
+ "apache-airflow>=2.7.0",
34
+ "apache-airflow-providers-common-sql>=1.6.0",
35
+ "attrs>=22.2",
36
+ "openlineage-integration-common>=0.28.0",
37
+ "openlineage-python>=0.28.0",
38
+ ],
39
+ "integrations": [
40
+ {
41
+ "integration-name": "OpenLineage",
42
+ "external-doc-url": "https://openlineage.io",
43
+ "logo": "/integration-logos/openlineage/openlineage.svg",
44
+ "tags": ["protocol"],
45
+ }
46
+ ],
47
+ "plugins": [
48
+ {
49
+ "name": "openlineage",
50
+ "plugin-class": "airflow.providers.openlineage.plugins.openlineage.OpenLineageProviderPlugin",
51
+ }
52
+ ],
53
+ "config": {
54
+ "openlineage": {
55
+ "description": "This section applies settings for OpenLineage integration.\nFor backwards compatibility with `openlineage-python` one can still use\n`openlineage.yml` file or `OPENLINEAGE_` environment variables. However, below\nconfiguration takes precedence over those.\nMore in documentation - https://openlineage.io/docs/client/python#configuration.\n",
56
+ "options": {
57
+ "disabled": {
58
+ "description": "Set this to true if you don't want OpenLineage to emit events.\n",
59
+ "type": "boolean",
60
+ "example": None,
61
+ "default": "False",
62
+ "version_added": None,
63
+ },
64
+ "namespace": {
65
+ "description": "OpenLineage namespace\n",
66
+ "version_added": None,
67
+ "type": "string",
68
+ "example": "food_delivery",
69
+ "default": None,
70
+ },
71
+ "extractors": {
72
+ "description": "Comma-separated paths to custom OpenLineage extractors.\n",
73
+ "type": "string",
74
+ "example": "full.path.to.ExtractorClass;full.path.to.AnotherExtractorClass",
75
+ "default": "",
76
+ "version_added": None,
77
+ },
78
+ "config_path": {
79
+ "description": "Path to YAML config. This provides backwards compatibility to pass config as\n`openlineage.yml` file.\n",
80
+ "version_added": None,
81
+ "type": "string",
82
+ "example": None,
83
+ "default": "",
84
+ },
85
+ "transport": {
86
+ "description": "OpenLineage Client transport configuration. It should contain type\nand additional options per each type.\n\nCurrently supported types are:\n\n * HTTP\n * Kafka\n * Console\n",
87
+ "type": "string",
88
+ "example": '{"type": "http", "url": "http://localhost:5000"}',
89
+ "default": "",
90
+ "version_added": None,
91
+ },
92
+ "disable_source_code": {
93
+ "description": "If disabled, OpenLineage events do not contain source code of particular\noperators, like PythonOperator.\n",
94
+ "default": None,
95
+ "example": None,
96
+ "type": "boolean",
97
+ "version_added": None,
98
+ },
99
+ },
100
+ }
101
+ },
102
+ }
@@ -25,8 +25,14 @@ from airflow.providers.openlineage.plugins.macros import lineage_parent_id, line
25
25
 
26
26
  def _is_disabled() -> bool:
27
27
  return (
28
- conf.getboolean("openlineage", "disabled")
28
+ conf.getboolean("openlineage", "disabled", fallback=False)
29
29
  or os.getenv("OPENLINEAGE_DISABLED", "false").lower() == "true"
30
+ or (
31
+ conf.get("openlineage", "transport", fallback="") == ""
32
+ and conf.get("openlineage", "config_path", fallback="") == ""
33
+ and os.getenv("OPENLINEAGE_URL", "") == ""
34
+ and os.getenv("OPENLINEAGE_CONFIG", "") == ""
35
+ )
30
36
  )
31
37
 
32
38
 
@@ -39,8 +45,8 @@ class OpenLineageProviderPlugin(AirflowPlugin):
39
45
  """
40
46
 
41
47
  name = "OpenLineageProviderPlugin"
42
- macros = [lineage_run_id, lineage_parent_id]
43
48
  if not _is_disabled():
44
49
  from airflow.providers.openlineage.plugins.listener import OpenLineageListener
45
50
 
51
+ macros = [lineage_run_id, lineage_parent_id]
46
52
  listeners = [OpenLineageListener()]
@@ -291,6 +291,6 @@ class SQLParser:
291
291
  else:
292
292
  db = None
293
293
  schemas = hierarchy.setdefault(normalize_name(db) if db else db, {})
294
- tables = schemas.setdefault(normalize_name(table.schema) if table.schema else db, [])
294
+ tables = schemas.setdefault(normalize_name(table.schema) if table.schema else None, [])
295
295
  tables.append(table.name)
296
296
  return hierarchy
@@ -23,7 +23,7 @@ import logging
23
23
  import os
24
24
  from contextlib import suppress
25
25
  from functools import wraps
26
- from typing import TYPE_CHECKING, Any
26
+ from typing import TYPE_CHECKING, Any, Iterable
27
27
  from urllib.parse import parse_qsl, urlencode, urlparse, urlunparse
28
28
 
29
29
  import attrs
@@ -414,3 +414,10 @@ def is_source_enabled() -> bool:
414
414
  def get_filtered_unknown_operator_keys(operator: BaseOperator) -> dict:
415
415
  not_required_keys = {"dag", "task_group"}
416
416
  return {attr: value for attr, value in operator.__dict__.items() if attr not in not_required_keys}
417
+
418
+
419
+ def normalize_sql(sql: str | Iterable[str]):
420
+ if isinstance(sql, str):
421
+ sql = [stmt for stmt in sql.split(";") if stmt != ""]
422
+ sql = [obj for stmt in sql for obj in stmt.split(";") if obj != ""]
423
+ return ";\n".join(sql)
@@ -1,14 +1,14 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: apache-airflow-providers-openlineage
3
- Version: 1.0.0
3
+ Version: 1.0.1
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.0.0/
11
- Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.0.0/changelog.html
10
+ Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.0.1/
11
+ Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.0.1/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
@@ -71,7 +71,7 @@ License-File: NOTICE
71
71
 
72
72
  Package ``apache-airflow-providers-openlineage``
73
73
 
74
- Release: ``1.0.0``
74
+ Release: ``1.0.1``
75
75
 
76
76
 
77
77
  `OpenLineage <https://openlineage.io/>`__
@@ -84,7 +84,7 @@ This is a provider package for ``openlineage`` provider. All classes for this pr
84
84
  are in ``airflow.providers.openlineage`` python package.
85
85
 
86
86
  You can find package information and changelog for the provider
87
- in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.0.0/>`_.
87
+ in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.0.1/>`_.
88
88
 
89
89
 
90
90
  Installation
@@ -129,4 +129,4 @@ Dependent package
129
129
  ============================================================================================================ ==============
130
130
 
131
131
  The changelog for the provider package can be found in the
132
- `changelog <https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.0.0/changelog.html>`_.
132
+ `changelog <https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.0.1/changelog.html>`_.
@@ -103,6 +103,7 @@ filterwarnings = [
103
103
  ]
104
104
  python_files = [
105
105
  "test_*.py",
106
+ "example_*.py",
106
107
  ]
107
108
  testpaths = [
108
109
  "tests",
@@ -27,8 +27,8 @@ classifiers =
27
27
  Programming Language :: Python :: 3.11
28
28
  Topic :: System :: Monitoring
29
29
  project_urls =
30
- Documentation=https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.0.0/
31
- Changelog=https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.0.0/changelog.html
30
+ Documentation=https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.0.1/
31
+ Changelog=https://airflow.apache.org/docs/apache-airflow-providers-openlineage/1.0.1/changelog.html
32
32
  Bug Tracker=https://github.com/apache/airflow/issues
33
33
  Source Code=https://github.com/apache/airflow
34
34
  Slack Chat=https://s.apache.org/airflow-slack
@@ -26,7 +26,7 @@
26
26
 
27
27
  from setuptools import find_namespace_packages, setup
28
28
 
29
- version = "1.0.0"
29
+ version = "1.0.1"
30
30
 
31
31
 
32
32
  def do_setup():
@@ -1,53 +0,0 @@
1
- # Licensed to the Apache Software Foundation (ASF) under one
2
- # or more contributor license agreements. See the NOTICE file
3
- # distributed with this work for additional information
4
- # regarding copyright ownership. The ASF licenses this file
5
- # to you under the Apache License, Version 2.0 (the
6
- # "License"); you may not use this file except in compliance
7
- # with the License. You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing,
12
- # software distributed under the License is distributed on an
13
- # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
- # KIND, either express or implied. See the License for the
15
- # specific language governing permissions and limitations
16
- # under the License.
17
-
18
- # NOTE! THIS FILE IS AUTOMATICALLY GENERATED AND WILL BE
19
- # OVERWRITTEN WHEN PREPARING PACKAGES.
20
- #
21
- # IF YOU WANT TO MODIFY IT, YOU SHOULD MODIFY THE TEMPLATE
22
- # `get_provider_info_TEMPLATE.py.jinja2` IN the `provider_packages` DIRECTORY
23
-
24
-
25
- def get_provider_info():
26
- return {
27
- "package-name": "apache-airflow-providers-openlineage",
28
- "name": "OpenLineage Airflow",
29
- "description": "`OpenLineage <https://openlineage.io/>`__\n",
30
- "suspended": False,
31
- "versions": ["1.0.0"],
32
- "dependencies": [
33
- "apache-airflow>=2.7.0",
34
- "apache-airflow-providers-common-sql>=1.6.0",
35
- "attrs>=22.2",
36
- "openlineage-integration-common>=0.28.0",
37
- "openlineage-python>=0.28.0",
38
- ],
39
- "integrations": [
40
- {
41
- "integration-name": "OpenLineage",
42
- "external-doc-url": "https://openlineage.io",
43
- "logo": "/integration-logos/openlineage/openlineage.svg",
44
- "tags": ["protocol"],
45
- }
46
- ],
47
- "plugins": [
48
- {
49
- "name": "openlineage",
50
- "plugin-class": "airflow.providers.openlineage.plugins.openlineage.OpenLineageProviderPlugin",
51
- }
52
- ],
53
- }