datahub-yaml-source 0.1.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.
Potentially problematic release.
This version of datahub-yaml-source might be problematic. Click here for more details.
- datahub_yaml_source-0.1.0/CONTRIBUTING.md +109 -0
- datahub_yaml_source-0.1.0/LICENSE +190 -0
- datahub_yaml_source-0.1.0/MANIFEST.in +20 -0
- datahub_yaml_source-0.1.0/PKG-INFO +124 -0
- datahub_yaml_source-0.1.0/README.md +66 -0
- datahub_yaml_source-0.1.0/pyproject.toml +70 -0
- datahub_yaml_source-0.1.0/setup.cfg +4 -0
- datahub_yaml_source-0.1.0/setup.py +117 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source/__init__.py +11 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source/builders/__init__.py +0 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source/builders/application.py +68 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source/builders/assertion.py +254 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source/builders/chart.py +41 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source/builders/common.py +489 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source/builders/container.py +145 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source/builders/dashboard.py +45 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source/builders/data_flow_job.py +95 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source/builders/data_process_instance.py +64 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source/builders/data_product.py +31 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source/builders/dataset.py +147 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source/builders/document.py +77 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source/builders/domain.py +73 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source/builders/glossary.py +115 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source/builders/incident.py +74 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source/builders/ml.py +271 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source/builders/platform.py +21 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source/builders/query.py +49 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source/builders/raw_aspect.py +236 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source/builders/semantic.py +150 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source/builders/software.py +253 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source/builders/structured_property.py +54 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source/builders/tag.py +22 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source/loader.py +404 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source/models.py +1812 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source/urns.py +315 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source/yaml_source.py +605 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source/yaml_source_config.py +200 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source/yaml_source_report.py +81 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source.egg-info/PKG-INFO +124 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source.egg-info/SOURCES.txt +44 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source.egg-info/dependency_links.txt +1 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source.egg-info/entry_points.txt +2 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source.egg-info/requires.txt +21 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source.egg-info/scm_file_list.json +97 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source.egg-info/scm_version.json +8 -0
- datahub_yaml_source-0.1.0/src/datahub_yaml_source.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Thanks for considering a contribution to `datahub-yaml-source`.
|
|
4
|
+
|
|
5
|
+
## Development setup
|
|
6
|
+
|
|
7
|
+
Supported Python versions: 3.10, 3.11, 3.12 (the floor tracked in `setup.py`'s
|
|
8
|
+
`python_requires`, matching `acryl-datahub`'s own Python >=3.10 requirement).
|
|
9
|
+
CI (`.github/workflows/ci.yml`) runs the test suite on all three.
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pip install -e ".[dev]"
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
This installs the connector in editable mode and registers the `yaml` source
|
|
16
|
+
type with `acryl-datahub` via a `datahub.ingestion.source.plugins` entry
|
|
17
|
+
point. Verify it's picked up with:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
datahub check plugins
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Running the tests
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pytest tests/unit # unit tests
|
|
27
|
+
pytest tests/integration # integration test against a curated fixture,
|
|
28
|
+
# golden-file checked
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
If you intentionally change the connector's output, refresh the integration
|
|
32
|
+
golden file and review the diff by hand before committing it:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
pytest tests/integration/yaml_source/test_yaml_source_golden.py --update-golden-files
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Regenerating derived docs
|
|
39
|
+
|
|
40
|
+
`docs/sources/yaml/reference.md` and
|
|
41
|
+
`docs/sources/yaml/schema/yaml-metadata.schema.json` are generated from the
|
|
42
|
+
Pydantic models in `src/datahub_yaml_source/models.py`. Any change to those
|
|
43
|
+
models must be followed by:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
python scripts/generate_json_schema.py
|
|
47
|
+
python scripts/generate_markdown_docs.py
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
`tests/unit/test_json_schema_generation.py` and
|
|
51
|
+
`tests/unit/test_markdown_docs_generation.py` fail if these artifacts are out
|
|
52
|
+
of sync with the models, so this step is not optional.
|
|
53
|
+
|
|
54
|
+
## Adding a new `kind:` or aspect
|
|
55
|
+
|
|
56
|
+
A new document kind or a new field typically touches: the Pydantic model in
|
|
57
|
+
`models.py`, the relevant builder in `src/datahub_yaml_source/builders/`,
|
|
58
|
+
`urns.py` for any new URN helper, `loader.py` / `yaml_source.py` /
|
|
59
|
+
`yaml_source_report.py` for a brand-new kind, the regenerated docs above, unit
|
|
60
|
+
tests for the model and builder, and an addition to the integration fixture
|
|
61
|
+
tree under `tests/integration/yaml_source/resources/` with a refreshed golden
|
|
62
|
+
file.
|
|
63
|
+
|
|
64
|
+
See `_PLANNING.md` for the architecture rationale (why SDK V2 vs. raw MCP per
|
|
65
|
+
kind, emission ordering, reference-resolution strategy).
|
|
66
|
+
|
|
67
|
+
## Code style
|
|
68
|
+
|
|
69
|
+
- No SQL parsing, no live connection: this source's entire job is translating
|
|
70
|
+
declarative YAML into DataHub metadata. Keep new code consistent with that
|
|
71
|
+
scope.
|
|
72
|
+
- Prefer DataHub's SDK V2 (`datahub.sdk.*`) where a wrapper exists for the
|
|
73
|
+
entity type; fall back to `MetadataChangeProposalWrapper` otherwise. Never
|
|
74
|
+
use the legacy MCE API.
|
|
75
|
+
- A malformed or unresolvable document should produce a warning on the
|
|
76
|
+
ingestion report and be skipped, not crash the whole run, unless
|
|
77
|
+
`fail_on_unresolved_reference` is set.
|
|
78
|
+
|
|
79
|
+
### Lint, format, and types
|
|
80
|
+
|
|
81
|
+
Ruff and mypy are installed by the `dev` extra. Before pushing, run the same
|
|
82
|
+
checks CI runs (`.github/workflows/quality.yml`, contract in
|
|
83
|
+
`spec/spec-process-cicd-quality.md`):
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
ruff check . # lint (blocking in CI)
|
|
87
|
+
ruff format --check . # formatting (blocking in CI); drop --check to apply
|
|
88
|
+
mypy # type check over src/ (blocking in CI)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
`ruff check --fix .` auto-fixes most lint findings. `ruff` config
|
|
92
|
+
(`[tool.ruff]`, line length 100, target `py310`) and `mypy` config
|
|
93
|
+
(`[tool.mypy]`, `src/` only, non-strict) both live in `pyproject.toml`. The mypy
|
|
94
|
+
baseline is zero — `mypy` must exit clean before a PR can merge. Fix a new error
|
|
95
|
+
with a real annotation/guard; a `# type: ignore[<code>]` is a last resort and
|
|
96
|
+
needs a one-line reason.
|
|
97
|
+
|
|
98
|
+
## Submitting changes
|
|
99
|
+
|
|
100
|
+
1. Open an issue or discussion first for anything beyond a small fix, so the
|
|
101
|
+
approach can be agreed before you invest time in it.
|
|
102
|
+
2. Keep pull requests focused — one logical change per PR.
|
|
103
|
+
3. Make sure `pytest tests/unit tests/integration` passes and that generated
|
|
104
|
+
docs/schema are committed alongside any model change.
|
|
105
|
+
4. Describe *why* the change is needed, not just what it does — the commit
|
|
106
|
+
message and PR description should stand on their own.
|
|
107
|
+
|
|
108
|
+
By contributing, you agree that your contributions will be licensed under the
|
|
109
|
+
project's [Apache License 2.0](LICENSE).
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the
|
|
44
|
+
purposes of this License, Derivative Works shall not include works
|
|
45
|
+
that remain separable from, or merely link (or bind by name) to the
|
|
46
|
+
interfaces of, the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
Copyright 2026 Assistance Publique - Hopitaux de Paris (AP-HP)
|
|
179
|
+
|
|
180
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
181
|
+
you may not use this file except in compliance with the License.
|
|
182
|
+
You may obtain a copy of the License at
|
|
183
|
+
|
|
184
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
185
|
+
|
|
186
|
+
Unless required by applicable law or agreed to in writing, software
|
|
187
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
188
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
189
|
+
See the License for the specific language governing permissions and
|
|
190
|
+
limitations under the License.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# setuptools-scm (pyproject.toml [tool.setuptools_scm]) turns on a file
|
|
2
|
+
# finder that otherwise sweeps *every* Git-tracked path into the sdist.
|
|
3
|
+
# Keep the sdist to what a consumer of the package actually needs; the
|
|
4
|
+
# rest lives on GitHub.
|
|
5
|
+
|
|
6
|
+
prune tests
|
|
7
|
+
prune docs
|
|
8
|
+
prune spec
|
|
9
|
+
prune scripts
|
|
10
|
+
prune .github
|
|
11
|
+
|
|
12
|
+
exclude AGENTS.md
|
|
13
|
+
exclude CLAUDE.md
|
|
14
|
+
exclude _PLANNING.md
|
|
15
|
+
exclude skills-lock.json
|
|
16
|
+
exclude bash.exe.stackdump
|
|
17
|
+
exclude .gitignore
|
|
18
|
+
|
|
19
|
+
include LICENSE
|
|
20
|
+
include README.md
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: datahub-yaml-source
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: DataHub ingestion source that reads declarative YAML metadata files.
|
|
5
|
+
Home-page: https://github.com/davidouagne/datahub-yaml-source
|
|
6
|
+
Author: David Ouagne
|
|
7
|
+
Author-email: david.ouagne@aphp.fr
|
|
8
|
+
License: Apache-2.0
|
|
9
|
+
Project-URL: Homepage, https://github.com/davidouagne/datahub-yaml-source
|
|
10
|
+
Project-URL: Issues, https://github.com/davidouagne/datahub-yaml-source/issues
|
|
11
|
+
Project-URL: Changelog, https://github.com/davidouagne/datahub-yaml-source/releases
|
|
12
|
+
Keywords: datahub,metadata,ingestion,yaml,metadata-as-code,data-catalog
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: Information Technology
|
|
16
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Topic :: Database
|
|
22
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Requires-Dist: acryl-datahub<1.8,>=1.7.0.9
|
|
27
|
+
Requires-Dist: pyyaml>=6.0
|
|
28
|
+
Requires-Dist: pydantic<3.0.0,>=2.4.0
|
|
29
|
+
Requires-Dist: requests<3,>=2.28.0
|
|
30
|
+
Provides-Extra: git
|
|
31
|
+
Requires-Dist: GitPython<4,>=3.1.37; extra == "git"
|
|
32
|
+
Provides-Extra: s3
|
|
33
|
+
Requires-Dist: boto3<2,>=1.35.0; extra == "s3"
|
|
34
|
+
Provides-Extra: dev
|
|
35
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
36
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
|
37
|
+
Requires-Dist: deepdiff>=6.0.0; extra == "dev"
|
|
38
|
+
Requires-Dist: jsonschema>=4.0.0; extra == "dev"
|
|
39
|
+
Requires-Dist: GitPython<4,>=3.1.37; extra == "dev"
|
|
40
|
+
Requires-Dist: boto3<2,>=1.35.0; extra == "dev"
|
|
41
|
+
Requires-Dist: ruff<0.17,>=0.12; extra == "dev"
|
|
42
|
+
Requires-Dist: mypy>=1.17; extra == "dev"
|
|
43
|
+
Requires-Dist: types-PyYAML>=6.0; extra == "dev"
|
|
44
|
+
Dynamic: author
|
|
45
|
+
Dynamic: author-email
|
|
46
|
+
Dynamic: classifier
|
|
47
|
+
Dynamic: description
|
|
48
|
+
Dynamic: description-content-type
|
|
49
|
+
Dynamic: home-page
|
|
50
|
+
Dynamic: keywords
|
|
51
|
+
Dynamic: license
|
|
52
|
+
Dynamic: license-file
|
|
53
|
+
Dynamic: project-url
|
|
54
|
+
Dynamic: provides-extra
|
|
55
|
+
Dynamic: requires-dist
|
|
56
|
+
Dynamic: requires-python
|
|
57
|
+
Dynamic: summary
|
|
58
|
+
|
|
59
|
+
# datahub-yaml-source
|
|
60
|
+
|
|
61
|
+
[](https://github.com/davidouagne/datahub-yaml-source/actions/workflows/ci.yml)
|
|
62
|
+
[](https://pypi.org/project/datahub-yaml-source/)
|
|
63
|
+
[](https://pypi.org/project/datahub-yaml-source/)
|
|
64
|
+
[](https://github.com/davidouagne/datahub-yaml-source/blob/main/LICENSE)
|
|
65
|
+
|
|
66
|
+
A standalone [DataHub](https://datahubproject.io/) ingestion source plugin that
|
|
67
|
+
reads a directory tree of declarative YAML "metadata as code" files and emits
|
|
68
|
+
the DataHub entities they describe (platforms, tags, glossary, domains,
|
|
69
|
+
containers, datasets with schema/lineage, data products, pipelines, pipeline
|
|
70
|
+
run history, and data quality assertions).
|
|
71
|
+
|
|
72
|
+
See [docs/sources/yaml/yaml.md](https://github.com/davidouagne/datahub-yaml-source/blob/main/docs/sources/yaml/yaml.md) for a narrative
|
|
73
|
+
introduction, [docs/sources/yaml/reference.md](https://github.com/davidouagne/datahub-yaml-source/blob/main/docs/sources/yaml/reference.md)
|
|
74
|
+
for a generated field-by-field reference of every `kind`, and
|
|
75
|
+
[docs/sources/yaml/yaml_recipe.yml](https://github.com/davidouagne/datahub-yaml-source/blob/main/docs/sources/yaml/yaml_recipe.yml) for an
|
|
76
|
+
example recipe. See [_PLANNING.md](https://github.com/davidouagne/datahub-yaml-source/blob/main/_PLANNING.md) for the architecture
|
|
77
|
+
decisions behind this connector.
|
|
78
|
+
|
|
79
|
+
A [JSON Schema](https://github.com/davidouagne/datahub-yaml-source/blob/main/docs/sources/yaml/schema/yaml-metadata.schema.json) for the
|
|
80
|
+
document format (autocomplete/validation in VS Code, IntelliJ, ...) is also
|
|
81
|
+
generated from the Pydantic models -- see the "Editor autocomplete and
|
|
82
|
+
validation" section in `yaml.md`.
|
|
83
|
+
|
|
84
|
+
Both `reference.md` and the JSON Schema are generated from
|
|
85
|
+
`src/datahub_yaml_source/models.py`; regenerate them after changing a model:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
python scripts/generate_json_schema.py
|
|
89
|
+
python scripts/generate_markdown_docs.py
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Installation
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
pip install -e .
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
This registers the `yaml` source type with `acryl-datahub` via a
|
|
99
|
+
`datahub.ingestion.source.plugins` entry point. Verify it's picked up with:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
datahub check plugins
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Usage
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
datahub ingest -c docs/sources/yaml/yaml_recipe.yml
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Development
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
pip install -e ".[dev]"
|
|
115
|
+
pytest tests/unit # unit tests
|
|
116
|
+
pytest tests/integration # integration test against a curated fixture,
|
|
117
|
+
# golden-file checked
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
To regenerate the integration golden file after an intentional output change:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
pytest tests/integration/yaml_source/test_yaml_source_golden.py --update-golden-files
|
|
124
|
+
```
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# datahub-yaml-source
|
|
2
|
+
|
|
3
|
+
[](https://github.com/davidouagne/datahub-yaml-source/actions/workflows/ci.yml)
|
|
4
|
+
[](https://pypi.org/project/datahub-yaml-source/)
|
|
5
|
+
[](https://pypi.org/project/datahub-yaml-source/)
|
|
6
|
+
[](https://github.com/davidouagne/datahub-yaml-source/blob/main/LICENSE)
|
|
7
|
+
|
|
8
|
+
A standalone [DataHub](https://datahubproject.io/) ingestion source plugin that
|
|
9
|
+
reads a directory tree of declarative YAML "metadata as code" files and emits
|
|
10
|
+
the DataHub entities they describe (platforms, tags, glossary, domains,
|
|
11
|
+
containers, datasets with schema/lineage, data products, pipelines, pipeline
|
|
12
|
+
run history, and data quality assertions).
|
|
13
|
+
|
|
14
|
+
See [docs/sources/yaml/yaml.md](https://github.com/davidouagne/datahub-yaml-source/blob/main/docs/sources/yaml/yaml.md) for a narrative
|
|
15
|
+
introduction, [docs/sources/yaml/reference.md](https://github.com/davidouagne/datahub-yaml-source/blob/main/docs/sources/yaml/reference.md)
|
|
16
|
+
for a generated field-by-field reference of every `kind`, and
|
|
17
|
+
[docs/sources/yaml/yaml_recipe.yml](https://github.com/davidouagne/datahub-yaml-source/blob/main/docs/sources/yaml/yaml_recipe.yml) for an
|
|
18
|
+
example recipe. See [_PLANNING.md](https://github.com/davidouagne/datahub-yaml-source/blob/main/_PLANNING.md) for the architecture
|
|
19
|
+
decisions behind this connector.
|
|
20
|
+
|
|
21
|
+
A [JSON Schema](https://github.com/davidouagne/datahub-yaml-source/blob/main/docs/sources/yaml/schema/yaml-metadata.schema.json) for the
|
|
22
|
+
document format (autocomplete/validation in VS Code, IntelliJ, ...) is also
|
|
23
|
+
generated from the Pydantic models -- see the "Editor autocomplete and
|
|
24
|
+
validation" section in `yaml.md`.
|
|
25
|
+
|
|
26
|
+
Both `reference.md` and the JSON Schema are generated from
|
|
27
|
+
`src/datahub_yaml_source/models.py`; regenerate them after changing a model:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
python scripts/generate_json_schema.py
|
|
31
|
+
python scripts/generate_markdown_docs.py
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Installation
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pip install -e .
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
This registers the `yaml` source type with `acryl-datahub` via a
|
|
41
|
+
`datahub.ingestion.source.plugins` entry point. Verify it's picked up with:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
datahub check plugins
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Usage
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
datahub ingest -c docs/sources/yaml/yaml_recipe.yml
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Development
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
pip install -e ".[dev]"
|
|
57
|
+
pytest tests/unit # unit tests
|
|
58
|
+
pytest tests/integration # integration test against a curated fixture,
|
|
59
|
+
# golden-file checked
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
To regenerate the integration golden file after an intentional output change:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pytest tests/integration/yaml_source/test_yaml_source_golden.py --update-golden-files
|
|
66
|
+
```
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# setup.py still holds the package metadata (deps, extras, entry points);
|
|
2
|
+
# this file adds the PEP 517 build-system and the tool config that Ruff,
|
|
3
|
+
# mypy and setuptools-scm look for here first. The package version is not
|
|
4
|
+
# written anywhere -- setuptools-scm derives it from Git tags at build
|
|
5
|
+
# time (see [tool.setuptools_scm] below and
|
|
6
|
+
# spec/spec-process-cicd-quality.md / spec-process-cicd-ci.md for the CI
|
|
7
|
+
# `fetch-depth: 0` this needs).
|
|
8
|
+
|
|
9
|
+
[build-system]
|
|
10
|
+
requires = ["setuptools>=84.0.0", "setuptools-scm>=10.2.3,<11"]
|
|
11
|
+
build-backend = "setuptools.build_meta"
|
|
12
|
+
|
|
13
|
+
[tool.setuptools_scm]
|
|
14
|
+
# no-guess-dev: an untagged commit is X.Y.Z.post1.devN (explicitly "after
|
|
15
|
+
# the last release"), not X.Y.(Z+1).devN which would imply an unreleased
|
|
16
|
+
# future version that may never ship.
|
|
17
|
+
# no-local-version: drop the +g<hash> local segment -- PyPI / TestPyPI
|
|
18
|
+
# reject local versions, so any non-tag build (e.g. a CI dev upload)
|
|
19
|
+
# stays valid. Clean tag builds are unaffected either way.
|
|
20
|
+
# fallback_version: a build from a source archive with no .git and no
|
|
21
|
+
# SETUPTOOLS_SCM_PRETEND_VERSION degrades to 0.0.0 instead of hard-failing.
|
|
22
|
+
version_scheme = "no-guess-dev"
|
|
23
|
+
local_scheme = "no-local-version"
|
|
24
|
+
fallback_version = "0.0.0"
|
|
25
|
+
|
|
26
|
+
[tool.ruff]
|
|
27
|
+
line-length = 100
|
|
28
|
+
target-version = "py310"
|
|
29
|
+
src = ["src", "tests", "scripts"]
|
|
30
|
+
# Ruff's scope here is first-party Python only. Since 0.16 `ruff format` also
|
|
31
|
+
# reformats ```python blocks inside Markdown; the illustrative snippets in
|
|
32
|
+
# `_PLANNING.md` are hand-shaped for reading, so keep prose docs out.
|
|
33
|
+
extend-exclude = ["*.md"]
|
|
34
|
+
|
|
35
|
+
[tool.ruff.lint]
|
|
36
|
+
# Pragmatic set for a solo-maintained translation layer: pyflakes/pycodestyle
|
|
37
|
+
# errors (E, F), import sorting (I), pyupgrade (UP), flake8-bugbear (B),
|
|
38
|
+
# flake8-comprehensions (C4), flake8-simplify (SIM) and Ruff's own rules
|
|
39
|
+
# (RUF). Deliberately excludes annotation-completeness (ANN) and the
|
|
40
|
+
# opinionated pylint (PL) families to keep the signal high.
|
|
41
|
+
select = ["E", "F", "I", "UP", "B", "C4", "SIM", "RUF"]
|
|
42
|
+
|
|
43
|
+
[tool.ruff.lint.per-file-ignores]
|
|
44
|
+
# Re-export surfaces: an unused import is the point.
|
|
45
|
+
"__init__.py" = ["F401"]
|
|
46
|
+
# Test fixtures embed full DataHub URNs and JSON blobs as string literals;
|
|
47
|
+
# these are legitimately long and not meaningfully breakable. The formatter
|
|
48
|
+
# still enforces 100 cols on everything it can reflow.
|
|
49
|
+
"tests/**" = ["E501"]
|
|
50
|
+
|
|
51
|
+
[tool.ruff.lint.isort]
|
|
52
|
+
known-first-party = ["datahub_yaml_source"]
|
|
53
|
+
|
|
54
|
+
[tool.mypy]
|
|
55
|
+
# Advisory only -- the quality workflow runs this job with
|
|
56
|
+
# continue-on-error. Scope is the package itself; tests/ and scripts/ are
|
|
57
|
+
# left out until the src/ signal is clean. Non-strict baseline, with the
|
|
58
|
+
# few low-noise warnings that catch real staleness.
|
|
59
|
+
files = ["src"]
|
|
60
|
+
python_version = "3.10"
|
|
61
|
+
check_untyped_defs = true
|
|
62
|
+
warn_unused_ignores = true
|
|
63
|
+
warn_redundant_casts = true
|
|
64
|
+
|
|
65
|
+
[[tool.mypy.overrides]]
|
|
66
|
+
# acryl-datahub ships partial/absent type information; its generated
|
|
67
|
+
# metadata classes in particular are untyped. Don't let that drown the
|
|
68
|
+
# signal from our own code.
|
|
69
|
+
module = ["datahub.*", "deepdiff.*"]
|
|
70
|
+
ignore_missing_imports = true
|