openlineage-python 1.12.0__tar.gz → 1.14.0__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 (84) hide show
  1. openlineage_python-1.14.0/.gitignore +2 -0
  2. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/PKG-INFO +6 -1
  3. openlineage_python-1.14.0/docs/Makefile +20 -0
  4. openlineage_python-1.14.0/docs/conf.py +61 -0
  5. openlineage_python-1.14.0/docs/convert.py +76 -0
  6. openlineage_python-1.14.0/docs/index.rst +13 -0
  7. openlineage_python-1.14.0/docs/make.bat +35 -0
  8. openlineage_python-1.14.0/docs/release-api-reference.sh +48 -0
  9. openlineage_python-1.14.0/docs/source/openlineage.client.rst +330 -0
  10. openlineage_python-1.14.0/openlineage/client/__init__.py +15 -0
  11. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/openlineage/client/client.py +14 -7
  12. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/openlineage/client/constants.py +1 -1
  13. openlineage_python-1.14.0/openlineage/client/event_v2.py +35 -0
  14. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/openlineage/client/facet.py +14 -9
  15. openlineage_python-1.14.0/openlineage/client/facet_v2.py +74 -0
  16. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/openlineage/client/filter.py +7 -5
  17. openlineage_python-1.14.0/openlineage/client/generated/base.py +309 -0
  18. openlineage_python-1.14.0/openlineage/client/generated/column_lineage_dataset.py +47 -0
  19. openlineage_python-1.14.0/openlineage/client/generated/data_quality_assertions_dataset.py +35 -0
  20. openlineage_python-1.14.0/openlineage/client/generated/data_quality_metrics_input_dataset.py +47 -0
  21. openlineage_python-1.14.0/openlineage/client/generated/dataset_version_dataset.py +17 -0
  22. openlineage_python-1.14.0/openlineage/client/generated/datasource_dataset.py +26 -0
  23. openlineage_python-1.14.0/openlineage/client/generated/documentation_dataset.py +17 -0
  24. openlineage_python-1.14.0/openlineage/client/generated/documentation_job.py +19 -0
  25. openlineage_python-1.14.0/openlineage/client/generated/error_message_run.py +29 -0
  26. openlineage_python-1.14.0/openlineage/client/generated/external_query_run.py +22 -0
  27. openlineage_python-1.14.0/openlineage/client/generated/extraction_error_run.py +44 -0
  28. openlineage_python-1.14.0/openlineage/client/generated/job_type_job.py +23 -0
  29. openlineage_python-1.14.0/openlineage/client/generated/lifecycle_state_change_dataset.py +42 -0
  30. openlineage_python-1.14.0/openlineage/client/generated/nominal_time_run.py +48 -0
  31. openlineage_python-1.14.0/openlineage/client/generated/output_statistics_output_dataset.py +27 -0
  32. openlineage_python-1.14.0/openlineage/client/generated/ownership_dataset.py +31 -0
  33. openlineage_python-1.14.0/openlineage/client/generated/ownership_job.py +29 -0
  34. openlineage_python-1.14.0/openlineage/client/generated/parent_run.py +58 -0
  35. openlineage_python-1.14.0/openlineage/client/generated/processing_engine_run.py +23 -0
  36. openlineage_python-1.14.0/openlineage/client/generated/schema_dataset.py +39 -0
  37. openlineage_python-1.14.0/openlineage/client/generated/source_code_job.py +24 -0
  38. openlineage_python-1.14.0/openlineage/client/generated/source_code_location_job.py +45 -0
  39. openlineage_python-1.14.0/openlineage/client/generated/sql_job.py +16 -0
  40. openlineage_python-1.14.0/openlineage/client/generated/storage_dataset.py +20 -0
  41. openlineage_python-1.14.0/openlineage/client/generated/symlinks_dataset.py +31 -0
  42. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/openlineage/client/run.py +5 -0
  43. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/openlineage/client/transport/console.py +3 -3
  44. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/openlineage/client/transport/file.py +2 -2
  45. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/openlineage/client/transport/http.py +31 -12
  46. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/openlineage/client/transport/kafka.py +62 -4
  47. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/openlineage/client/transport/noop.py +3 -3
  48. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/openlineage/client/transport/transport.py +3 -3
  49. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/openlineage/client/utils.py +2 -2
  50. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/pyproject.toml +8 -1
  51. openlineage_python-1.14.0/redact_fields.yml +188 -0
  52. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/tests/config/http.yml +1 -0
  53. openlineage_python-1.14.0/tests/example_full_event.json +104 -0
  54. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/tests/test_client.py +22 -9
  55. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/tests/test_facet.py +8 -8
  56. openlineage_python-1.14.0/tests/test_facet_v2.py +199 -0
  57. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/tests/test_http.py +48 -5
  58. openlineage_python-1.14.0/tests/test_kafka.py +322 -0
  59. openlineage_python-1.14.0/tests/test_utils.py +38 -0
  60. openlineage_python-1.12.0/.gitignore +0 -0
  61. openlineage_python-1.12.0/openlineage/client/__init__.py +0 -12
  62. openlineage_python-1.12.0/tests/test_kafka.py +0 -139
  63. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/README.md +0 -0
  64. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/openlineage/client/py.typed +0 -0
  65. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/openlineage/client/serde.py +0 -0
  66. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/openlineage/client/transport/__init__.py +0 -0
  67. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/openlineage/client/transport/factory.py +0 -0
  68. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/openlineage/client/transport/msk_iam.py +0 -0
  69. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/tests/__init__.py +0 -0
  70. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/tests/config/config.yml +0 -0
  71. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/tests/config/exact_filter.yml +0 -0
  72. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/tests/config/openlineage.yml +0 -0
  73. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/tests/config/regex_filter.yml +0 -0
  74. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/tests/conftest.py +0 -0
  75. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/tests/nominal_time_without_end.json +0 -0
  76. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/tests/serde_example_dataset_event.json +0 -0
  77. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/tests/serde_example_job_event.json +0 -0
  78. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/tests/serde_example_run_event.json +0 -0
  79. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/tests/test_events.py +0 -0
  80. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/tests/test_factory.py +0 -0
  81. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/tests/test_file.py +0 -0
  82. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/tests/test_msk_iam.py +0 -0
  83. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/tests/transport.py +0 -0
  84. {openlineage_python-1.12.0 → openlineage_python-1.14.0}/tox.ini +0 -0
@@ -0,0 +1,2 @@
1
+ _build
2
+ converted
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: openlineage-python
3
- Version: 1.12.0
3
+ Version: 1.14.0
4
4
  Summary: OpenLineage Python Client
5
5
  Author-email: OpenLineage <info@openlineage.io>
6
6
  Keywords: openlineage
@@ -18,6 +18,11 @@ Requires-Dist: packaging>=21.0
18
18
  Requires-Dist: python-dateutil>=2.8.2
19
19
  Requires-Dist: pyyaml>=5.4
20
20
  Requires-Dist: requests>=2.20.0
21
+ Provides-Extra: docs
22
+ Requires-Dist: beautifulsoup4>=4.12.0; extra == 'docs'
23
+ Requires-Dist: pydata-sphinx-theme>=0.13; extra == 'docs'
24
+ Requires-Dist: sphinx-autodoc-typehints>=2.0.0; extra == 'docs'
25
+ Requires-Dist: sphinx>=7.0; extra == 'docs'
21
26
  Provides-Extra: kafka
22
27
  Requires-Dist: confluent-kafka>=2.1.1; extra == 'kafka'
23
28
  Provides-Extra: msk-iam
@@ -0,0 +1,20 @@
1
+ # Minimal makefile for Sphinx documentation
2
+ #
3
+
4
+ # You can set these variables from the command line, and also
5
+ # from the environment for the first two.
6
+ SPHINXOPTS ?=
7
+ SPHINXBUILD ?= sphinx-build
8
+ SOURCEDIR = .
9
+ BUILDDIR = _build
10
+
11
+ # Put it first so that "make" without argument is like "make help".
12
+ help:
13
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14
+
15
+ .PHONY: help Makefile
16
+
17
+ # Catch-all target: route all unknown targets to Sphinx using the new
18
+ # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19
+ %: Makefile
20
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@@ -0,0 +1,61 @@
1
+ # Copyright 2018-2024 contributors to the OpenLineage project
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ # Configuration file for the Sphinx documentation builder.
5
+ #
6
+ # For the full list of built-in configuration values, see the documentation:
7
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html
8
+
9
+ # -- Project information -----------------------------------------------------
10
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
11
+
12
+ import builtins
13
+
14
+ builtins.__sphinx_build__ = True
15
+
16
+ project = "OpenLineage Python Client"
17
+ copyright = "2024, OpenLineage" # noqa: A001
18
+ author = "OpenLineage"
19
+
20
+ # -- General configuration ---------------------------------------------------
21
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
22
+
23
+ extensions = ["sphinx.ext.autodoc"]
24
+
25
+ templates_path = ["_templates"]
26
+ exclude_patterns = []
27
+
28
+ # -- Options for HTML output -------------------------------------------------
29
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
30
+
31
+ html_theme = "pydata_sphinx_theme"
32
+ html_static_path = ["_static"]
33
+
34
+ extensions = ["sphinx.ext.autodoc", "sphinx.ext.napoleon", "sphinx_autodoc_typehints"]
35
+
36
+ napoleon_use_param = True
37
+
38
+ autodoc_typehints = "description"
39
+ always_document_param_types = True
40
+
41
+ templates_path = ["_templates"]
42
+ exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "venv"]
43
+ source_suffix = [".rst"]
44
+
45
+ autodoc_default_options = {
46
+ "members": True,
47
+ "member-order": "bysource",
48
+ "undoc-members": True,
49
+ "show-inheritance": True,
50
+ }
51
+
52
+ autodoc_mock_imports = [
53
+ "confluent_kafka",
54
+ ]
55
+
56
+ # -- Options for HTML output -------------------------------------------------
57
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
58
+
59
+ html_theme = "pydata_sphinx_theme"
60
+
61
+ html_static_path = ["_static"]
@@ -0,0 +1,76 @@
1
+ # Copyright 2018-2024 contributors to the OpenLineage project
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ import json
5
+ import pathlib
6
+
7
+ from bs4 import BeautifulSoup
8
+
9
+ SPHINX_ROOT_DIR = pathlib.Path(__file__).parent.resolve()
10
+ SPHINX_BUILD_DIR = SPHINX_ROOT_DIR / pathlib.Path("_build/html/source")
11
+ DOCS_OUTPUT_DIR = SPHINX_ROOT_DIR / "converted"
12
+
13
+
14
+ def html_to_mdx(html: str) -> str:
15
+ # Because the HTML uses `class` and has `{}` in it, it isn't valid
16
+ # MDX. As such, we use React's dangerouslySetInnerHTML.
17
+ return f"""
18
+
19
+ <div dangerouslySetInnerHTML={{{{__html: {json.dumps(html)}}}}}></div>
20
+
21
+ """
22
+
23
+
24
+ def bs4_to_mdx(soup: BeautifulSoup, sidebar: BeautifulSoup) -> str:
25
+ return html_to_mdx(str(sidebar) + str(soup))
26
+
27
+
28
+ def convert_html_to_md(html_file: pathlib.Path) -> str:
29
+ html = html_file.read_text()
30
+ soup = BeautifulSoup(html, "html.parser")
31
+
32
+ body = soup.find("main").find("div", {"class": "bd-article-container"})
33
+ sidebar = soup.find("main").find("div", {"class": "bd-sidebar-secondary"})
34
+ article = body.find("article")
35
+
36
+ # Remove all the "permalink to this heading" links.
37
+ for link in article.find_all("a", {"class": "headerlink"}):
38
+ link.decompose()
39
+
40
+ # Remove the trailing " – " from arguments that are missing # noqa: RUF003
41
+ # a description.
42
+ for item in article.select("dl.field-list dd p"):
43
+ # Note - that's U+2013, not a normal hyphen.
44
+ if str(item).endswith(" – </p>"): # noqa: RUF001
45
+ parent = item.parent
46
+ new_item = BeautifulSoup(str(item)[:-7] + "</p>", "html.parser")
47
+ parent.p.replace_with(new_item)
48
+
49
+ # Extract title from the h1.
50
+ title_element = article.find("h1")
51
+ title = title_element.text
52
+ print(title)
53
+ title_element.decompose()
54
+
55
+ md_meta = f"""---
56
+ title: {title}
57
+ ---\n\n"""
58
+
59
+ return md_meta + bs4_to_mdx(article, sidebar)
60
+
61
+
62
+ def main():
63
+ DOCS_OUTPUT_DIR.mkdir(parents=True, exist_ok=True)
64
+
65
+ for doc in SPHINX_BUILD_DIR.glob("**/*.html"):
66
+ md = convert_html_to_md(doc)
67
+
68
+ outfile = DOCS_OUTPUT_DIR / doc.relative_to(SPHINX_BUILD_DIR).with_suffix(".md")
69
+ outfile.parent.mkdir(parents=True, exist_ok=True)
70
+ outfile.write_text(md)
71
+
72
+ print(f"Generated {outfile}")
73
+
74
+
75
+ if __name__ == "__main__":
76
+ main()
@@ -0,0 +1,13 @@
1
+ .. OpenLineage Python Client documentation master file, created by
2
+ sphinx-quickstart on Fri Mar 15 21:16:12 2024.
3
+ You can adapt this file completely to your liking, but it should at least
4
+ contain the root `toctree` directive.
5
+
6
+ Welcome to OpenLineage Python Client's documentation!
7
+ =====================================================
8
+
9
+ .. toctree::
10
+ :maxdepth: 1
11
+ :titlesonly:
12
+
13
+ source/openlineage.client
@@ -0,0 +1,35 @@
1
+ @ECHO OFF
2
+
3
+ pushd %~dp0
4
+
5
+ REM Command file for Sphinx documentation
6
+
7
+ if "%SPHINXBUILD%" == "" (
8
+ set SPHINXBUILD=sphinx-build
9
+ )
10
+ set SOURCEDIR=.
11
+ set BUILDDIR=_build
12
+
13
+ %SPHINXBUILD% >NUL 2>NUL
14
+ if errorlevel 9009 (
15
+ echo.
16
+ echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17
+ echo.installed, then set the SPHINXBUILD environment variable to point
18
+ echo.to the full path of the 'sphinx-build' executable. Alternatively you
19
+ echo.may add the Sphinx directory to PATH.
20
+ echo.
21
+ echo.If you don't have Sphinx installed, grab it from
22
+ echo.https://www.sphinx-doc.org/
23
+ exit /b 1
24
+ )
25
+
26
+ if "%1" == "" goto help
27
+
28
+ %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29
+ goto end
30
+
31
+ :help
32
+ %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33
+
34
+ :end
35
+ popd
@@ -0,0 +1,48 @@
1
+ #!/usr/bin/env bash
2
+ #
3
+ # Copyright 2018-2023 contributors to the OpenLineage project
4
+ # SPDX-License-Identifier: Apache-2.0
5
+ #
6
+
7
+ set -e
8
+
9
+ function git-website() {
10
+ command git --git-dir "$WEBSITE_DIR/.git" --work-tree "$WEBSITE_DIR" $@
11
+ }
12
+
13
+ git config --global user.email "openlineage-bot-key@openlineage.io"
14
+ git config --global user.name "OpenLineage deploy bot"
15
+
16
+ WEBSITE_DIR=${WEBSITE_DIR:-$HOME/build/website}
17
+ REFERENCE_DIR=/docs/development/developing/python/api-reference
18
+ REPO="git@github.com:OpenLineage/docs"
19
+ DEFAULT_BRANCH=main
20
+ BRANCH_NAME=${BRANCH_NAME:-$DEFAULT_BRANCH}
21
+
22
+ if [[ -d $WEBSITE_DIR ]]; then
23
+ # Check if we're in git repository and the repository points at website
24
+ if [[ $(git-website rev-parse --is-inside-work-tree) == "true" && $(git-website config --get remote.origin.url) == "$REPO" ]]; then
25
+ # Make sure we're at the head of the main branch
26
+ git checkout main
27
+ git reset --hard origin/master
28
+ else
29
+ echo "$WEBSITE_DIR is not empty - failing"
30
+ exit 1
31
+ fi
32
+ else
33
+ git clone -b $BRANCH_NAME --depth 1 $REPO $WEBSITE_DIR
34
+ fi
35
+
36
+ # check if there are any changes in javadoc in the latest commit
37
+ if [[ $(diff -qr --exclude _category_.json $WEBSITE_DIR$REFERENCE_DIR './converted' | wc -l) -eq 0 ]]; then
38
+ echo "no changes in python client reference detected, skipping publishing"
39
+ exit 0
40
+ fi
41
+
42
+ echo "Changes detected, updating python client reference..."
43
+ mv ./converted/* $WEBSITE_DIR$REFERENCE_DIR/
44
+
45
+ # commit new spec and push
46
+ git-website add -A $WEBSITE_DIR$REFERENCE_DIR
47
+ git --git-dir "$WEBSITE_DIR/.git" --work-tree "$WEBSITE_DIR" commit -s -m "openlineage python client reference update"
48
+ git-website push
@@ -0,0 +1,330 @@
1
+ Python Client
2
+ =============
3
+
4
+ openlineage.client.client module
5
+ -----------------------------------
6
+
7
+ .. automodule:: openlineage.client.client
8
+ :members:
9
+ :undoc-members:
10
+ :show-inheritance:
11
+
12
+ openlineage.client.event\_v2 module
13
+ -----------------------------------
14
+
15
+ .. automodule:: openlineage.client.event_v2
16
+ :members:
17
+ :undoc-members:
18
+ :show-inheritance:
19
+
20
+ openlineage.client.facet module
21
+ -------------------------------
22
+
23
+ .. automodule:: openlineage.client.facet
24
+ :members:
25
+ :undoc-members:
26
+ :show-inheritance:
27
+
28
+ openlineage.client.facet\_v2 module
29
+ -----------------------------------
30
+
31
+ .. automodule:: openlineage.client.facet_v2
32
+ :members:
33
+ :undoc-members:
34
+ :show-inheritance:
35
+
36
+ openlineage.client.filter module
37
+ --------------------------------
38
+
39
+ .. automodule:: openlineage.client.filter
40
+ :members:
41
+ :undoc-members:
42
+ :show-inheritance:
43
+
44
+ openlineage.client.run module
45
+ -----------------------------
46
+
47
+ .. automodule:: openlineage.client.run
48
+ :members:
49
+ :undoc-members:
50
+ :show-inheritance:
51
+
52
+ openlineage.client.serde module
53
+ -------------------------------
54
+
55
+ .. automodule:: openlineage.client.serde
56
+ :members:
57
+ :undoc-members:
58
+ :show-inheritance:
59
+
60
+ openlineage.client.utils module
61
+ -------------------------------
62
+
63
+ .. automodule:: openlineage.client.utils
64
+ :members:
65
+ :undoc-members:
66
+ :show-inheritance:
67
+
68
+ openlineage.client.generated.base module
69
+ ----------------------------------------
70
+
71
+ .. automodule:: openlineage.client.generated.base
72
+ :members:
73
+ :undoc-members:
74
+ :show-inheritance:
75
+
76
+ openlineage.client.generated.column\_lineage\_dataset module
77
+ ------------------------------------------------------------
78
+
79
+ .. automodule:: openlineage.client.generated.column_lineage_dataset
80
+ :members:
81
+ :undoc-members:
82
+ :show-inheritance:
83
+
84
+ openlineage.client.generated.data\_quality\_assertions\_dataset module
85
+ ----------------------------------------------------------------------
86
+
87
+ .. automodule:: openlineage.client.generated.data_quality_assertions_dataset
88
+ :members:
89
+ :undoc-members:
90
+ :show-inheritance:
91
+
92
+ openlineage.client.generated.data\_quality\_metrics\_input\_dataset module
93
+ --------------------------------------------------------------------------
94
+
95
+ .. automodule:: openlineage.client.generated.data_quality_metrics_input_dataset
96
+ :members:
97
+ :undoc-members:
98
+ :show-inheritance:
99
+
100
+ openlineage.client.generated.dataset\_version\_dataset module
101
+ -------------------------------------------------------------
102
+
103
+ .. automodule:: openlineage.client.generated.dataset_version_dataset
104
+ :members:
105
+ :undoc-members:
106
+ :show-inheritance:
107
+
108
+ openlineage.client.generated.datasource\_dataset module
109
+ -------------------------------------------------------
110
+
111
+ .. automodule:: openlineage.client.generated.datasource_dataset
112
+ :members:
113
+ :undoc-members:
114
+ :show-inheritance:
115
+
116
+ openlineage.client.generated.documentation\_dataset module
117
+ ----------------------------------------------------------
118
+
119
+ .. automodule:: openlineage.client.generated.documentation_dataset
120
+ :members:
121
+ :undoc-members:
122
+ :show-inheritance:
123
+
124
+ openlineage.client.generated.documentation\_job module
125
+ ------------------------------------------------------
126
+
127
+ .. automodule:: openlineage.client.generated.documentation_job
128
+ :members:
129
+ :undoc-members:
130
+ :show-inheritance:
131
+
132
+ openlineage.client.generated.error\_message\_run module
133
+ -------------------------------------------------------
134
+
135
+ .. automodule:: openlineage.client.generated.error_message_run
136
+ :members:
137
+ :undoc-members:
138
+ :show-inheritance:
139
+
140
+ openlineage.client.generated.external\_query\_run module
141
+ --------------------------------------------------------
142
+
143
+ .. automodule:: openlineage.client.generated.external_query_run
144
+ :members:
145
+ :undoc-members:
146
+ :show-inheritance:
147
+
148
+ openlineage.client.generated.extraction\_error\_run module
149
+ ----------------------------------------------------------
150
+
151
+ .. automodule:: openlineage.client.generated.extraction_error_run
152
+ :members:
153
+ :undoc-members:
154
+ :show-inheritance:
155
+
156
+ openlineage.client.generated.job\_type\_job module
157
+ --------------------------------------------------
158
+
159
+ .. automodule:: openlineage.client.generated.job_type_job
160
+ :members:
161
+ :undoc-members:
162
+ :show-inheritance:
163
+
164
+ openlineage.client.generated.lifecycle\_state\_change\_dataset module
165
+ ---------------------------------------------------------------------
166
+
167
+ .. automodule:: openlineage.client.generated.lifecycle_state_change_dataset
168
+ :members:
169
+ :undoc-members:
170
+ :show-inheritance:
171
+
172
+ openlineage.client.generated.nominal\_time\_run module
173
+ ------------------------------------------------------
174
+
175
+ .. automodule:: openlineage.client.generated.nominal_time_run
176
+ :members:
177
+ :undoc-members:
178
+ :show-inheritance:
179
+
180
+ openlineage.client.generated.output\_statistics\_output\_dataset module
181
+ -----------------------------------------------------------------------
182
+
183
+ .. automodule:: openlineage.client.generated.output_statistics_output_dataset
184
+ :members:
185
+ :undoc-members:
186
+ :show-inheritance:
187
+
188
+ openlineage.client.generated.ownership\_dataset module
189
+ ------------------------------------------------------
190
+
191
+ .. automodule:: openlineage.client.generated.ownership_dataset
192
+ :members:
193
+ :undoc-members:
194
+ :show-inheritance:
195
+
196
+ openlineage.client.generated.ownership\_job module
197
+ --------------------------------------------------
198
+
199
+ .. automodule:: openlineage.client.generated.ownership_job
200
+ :members:
201
+ :undoc-members:
202
+ :show-inheritance:
203
+
204
+ openlineage.client.generated.parent\_run module
205
+ -----------------------------------------------
206
+
207
+ .. automodule:: openlineage.client.generated.parent_run
208
+ :members:
209
+ :undoc-members:
210
+ :show-inheritance:
211
+
212
+ openlineage.client.generated.processing\_engine\_run module
213
+ -----------------------------------------------------------
214
+
215
+ .. automodule:: openlineage.client.generated.processing_engine_run
216
+ :members:
217
+ :undoc-members:
218
+ :show-inheritance:
219
+
220
+ openlineage.client.generated.schema\_dataset module
221
+ ---------------------------------------------------
222
+
223
+ .. automodule:: openlineage.client.generated.schema_dataset
224
+ :members:
225
+ :undoc-members:
226
+ :show-inheritance:
227
+
228
+ openlineage.client.generated.source\_code\_job module
229
+ -----------------------------------------------------
230
+
231
+ .. automodule:: openlineage.client.generated.source_code_job
232
+ :members:
233
+ :undoc-members:
234
+ :show-inheritance:
235
+
236
+ openlineage.client.generated.source\_code\_location\_job module
237
+ ---------------------------------------------------------------
238
+
239
+ .. automodule:: openlineage.client.generated.source_code_location_job
240
+ :members:
241
+ :undoc-members:
242
+ :show-inheritance:
243
+
244
+ openlineage.client.generated.sql\_job module
245
+ --------------------------------------------
246
+
247
+ .. automodule:: openlineage.client.generated.sql_job
248
+ :members:
249
+ :undoc-members:
250
+ :show-inheritance:
251
+
252
+ openlineage.client.generated.storage\_dataset module
253
+ ----------------------------------------------------
254
+
255
+ .. automodule:: openlineage.client.generated.storage_dataset
256
+ :members:
257
+ :undoc-members:
258
+ :show-inheritance:
259
+
260
+ openlineage.client.generated.symlinks\_dataset module
261
+ -----------------------------------------------------
262
+
263
+ .. automodule:: openlineage.client.generated.symlinks_dataset
264
+ :members:
265
+ :undoc-members:
266
+ :show-inheritance:
267
+
268
+ openlineage.client.transport.console module
269
+ -------------------------------------------
270
+
271
+ .. automodule:: openlineage.client.transport.console
272
+ :members:
273
+ :undoc-members:
274
+ :show-inheritance:
275
+
276
+ openlineage.client.transport.factory module
277
+ -------------------------------------------
278
+
279
+ .. automodule:: openlineage.client.transport.factory
280
+ :members:
281
+ :undoc-members:
282
+ :show-inheritance:
283
+
284
+ openlineage.client.transport.file module
285
+ ----------------------------------------
286
+
287
+ .. automodule:: openlineage.client.transport.file
288
+ :members:
289
+ :undoc-members:
290
+ :show-inheritance:
291
+
292
+ openlineage.client.transport.http module
293
+ ----------------------------------------
294
+
295
+ .. automodule:: openlineage.client.transport.http
296
+ :members:
297
+ :undoc-members:
298
+ :show-inheritance:
299
+
300
+ openlineage.client.transport.kafka module
301
+ -----------------------------------------
302
+
303
+ .. automodule:: openlineage.client.transport.kafka
304
+ :members:
305
+ :undoc-members:
306
+ :show-inheritance:
307
+
308
+ openlineage.client.transport.msk\_iam module
309
+ --------------------------------------------
310
+
311
+ .. automodule:: openlineage.client.transport.msk_iam
312
+ :members:
313
+ :undoc-members:
314
+ :show-inheritance:
315
+
316
+ openlineage.client.transport.noop module
317
+ ----------------------------------------
318
+
319
+ .. automodule:: openlineage.client.transport.noop
320
+ :members:
321
+ :undoc-members:
322
+ :show-inheritance:
323
+
324
+ openlineage.client.transport.transport module
325
+ ---------------------------------------------
326
+
327
+ .. automodule:: openlineage.client.transport.transport
328
+ :members:
329
+ :undoc-members:
330
+ :show-inheritance:
@@ -0,0 +1,15 @@
1
+ # Copyright 2018-2024 contributors to the OpenLineage project
2
+ # SPDX-License-Identifier: Apache-2.0
3
+ from __future__ import annotations
4
+
5
+ from openlineage.client.client import OpenLineageClient, OpenLineageClientOptions
6
+ from openlineage.client.facet import set_producer as set_producer_v1
7
+ from openlineage.client.facet_v2 import set_producer as set_producer_v2
8
+
9
+
10
+ def set_producer(producer: str) -> None:
11
+ set_producer_v1(producer)
12
+ set_producer_v2(producer)
13
+
14
+
15
+ __all__ = ["OpenLineageClient", "OpenLineageClientOptions", "set_producer"]
@@ -4,7 +4,7 @@ from __future__ import annotations
4
4
 
5
5
  import logging
6
6
  import os
7
- from typing import TYPE_CHECKING, Any, TypeVar
7
+ from typing import TYPE_CHECKING, Any, TypeVar, Union
8
8
 
9
9
  import attr
10
10
  from openlineage.client.filter import Filter, create_filter
@@ -15,10 +15,15 @@ if TYPE_CHECKING:
15
15
  from requests import Session
16
16
  from requests.adapters import HTTPAdapter
17
17
 
18
+ from openlineage.client import event_v2
18
19
  from openlineage.client.run import DatasetEvent, JobEvent, RunEvent
19
20
  from openlineage.client.transport import Transport, TransportFactory, get_default_factory
20
21
  from openlineage.client.transport.http import HttpConfig, HttpTransport
21
22
 
23
+ Event_v1 = Union[RunEvent, DatasetEvent, JobEvent]
24
+ Event_v2 = Union[event_v2.RunEvent, event_v2.DatasetEvent, event_v2.JobEvent]
25
+ Event = Union[Event_v1, Event_v2]
26
+
22
27
 
23
28
  @attr.s
24
29
  class OpenLineageClientOptions:
@@ -62,7 +67,7 @@ class OpenLineageClient:
62
67
  elif transport:
63
68
  self.transport = transport
64
69
  else:
65
- transport_config = None if "transport" not in self.config else self.config["transport"]
70
+ transport_config = self.config.get("transport", None)
66
71
  self.transport = factory.create(transport_config)
67
72
 
68
73
  self._filters: list[Filter] = []
@@ -86,10 +91,12 @@ class OpenLineageClient:
86
91
  ),
87
92
  )
88
93
 
89
- def emit(self, event: RunEvent | DatasetEvent | JobEvent) -> None:
90
- if not (isinstance(event, (RunEvent, DatasetEvent, JobEvent))):
94
+ def emit(self, event: Event) -> None:
95
+ from typing import get_args
96
+
97
+ if type(event) not in get_args(Event):
91
98
  msg = "`emit` only accepts RunEvent, DatasetEvent, JobEvent classes"
92
- raise ValueError(msg) # noqa: TRY004
99
+ raise ValueError(msg)
93
100
  if self._filters and self.filter_event(event) is None:
94
101
  return
95
102
  if not self.transport:
@@ -112,8 +119,8 @@ class OpenLineageClient:
112
119
 
113
120
  def filter_event(
114
121
  self,
115
- event: RunEvent | DatasetEvent | JobEvent,
116
- ) -> RunEvent | DatasetEvent | JobEvent | None:
122
+ event: Event,
123
+ ) -> Event | None:
117
124
  """Filters jobs according to config-defined events"""
118
125
  for _filter in self._filters:
119
126
  if isinstance(event, RunEvent) and _filter.filter_event(event) is None:
@@ -2,7 +2,7 @@
2
2
  # SPDX-License-Identifier: Apache-2.0
3
3
  from __future__ import annotations
4
4
 
5
- __version__ = "1.12.0"
5
+ __version__ = "1.14.0"
6
6
 
7
7
  DEFAULT_TIMEOUT_MS = 5000
8
8
  DEFAULT_NAMESPACE_NAME = "default"