altimate-datapilot-cli 0.0.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- altimate_datapilot_cli-0.0.8.dist-info/AUTHORS.rst +5 -0
- altimate_datapilot_cli-0.0.8.dist-info/LICENSE +9 -0
- altimate_datapilot_cli-0.0.8.dist-info/METADATA +102 -0
- altimate_datapilot_cli-0.0.8.dist-info/RECORD +139 -0
- altimate_datapilot_cli-0.0.8.dist-info/WHEEL +5 -0
- altimate_datapilot_cli-0.0.8.dist-info/entry_points.txt +4 -0
- altimate_datapilot_cli-0.0.8.dist-info/top_level.txt +1 -0
- datapilot/__init__.py +1 -0
- datapilot/__main__.py +14 -0
- datapilot/cli/__init__.py +0 -0
- datapilot/cli/main.py +11 -0
- datapilot/clients/__init__.py +0 -0
- datapilot/clients/altimate/__init__.py +0 -0
- datapilot/clients/altimate/client.py +85 -0
- datapilot/clients/altimate/utils.py +75 -0
- datapilot/config/__init__.py +0 -0
- datapilot/config/config.py +16 -0
- datapilot/config/utils.py +32 -0
- datapilot/core/__init__.py +0 -0
- datapilot/core/insights/__init__.py +2 -0
- datapilot/core/insights/base/__init__.py +0 -0
- datapilot/core/insights/base/insight.py +34 -0
- datapilot/core/insights/report.py +16 -0
- datapilot/core/insights/schema.py +24 -0
- datapilot/core/insights/sql/__init__.py +0 -0
- datapilot/core/insights/sql/base/__init__.py +0 -0
- datapilot/core/insights/sql/base/insight.py +18 -0
- datapilot/core/insights/sql/runtime/__init__.py +0 -0
- datapilot/core/insights/sql/static/__init__.py +0 -0
- datapilot/core/insights/utils.py +20 -0
- datapilot/core/platforms/__init__.py +0 -0
- datapilot/core/platforms/dbt/__init__.py +0 -0
- datapilot/core/platforms/dbt/cli/__init__.py +0 -0
- datapilot/core/platforms/dbt/cli/cli.py +112 -0
- datapilot/core/platforms/dbt/constants.py +34 -0
- datapilot/core/platforms/dbt/exceptions.py +6 -0
- datapilot/core/platforms/dbt/executor.py +157 -0
- datapilot/core/platforms/dbt/factory.py +22 -0
- datapilot/core/platforms/dbt/formatting.py +45 -0
- datapilot/core/platforms/dbt/hooks/__init__.py +0 -0
- datapilot/core/platforms/dbt/hooks/executor_hook.py +86 -0
- datapilot/core/platforms/dbt/insights/__init__.py +115 -0
- datapilot/core/platforms/dbt/insights/base.py +133 -0
- datapilot/core/platforms/dbt/insights/checks/__init__.py +0 -0
- datapilot/core/platforms/dbt/insights/checks/base.py +26 -0
- datapilot/core/platforms/dbt/insights/checks/check_column_desc_are_same.py +105 -0
- datapilot/core/platforms/dbt/insights/checks/check_column_name_contract.py +154 -0
- datapilot/core/platforms/dbt/insights/checks/check_macro_args_have_desc.py +75 -0
- datapilot/core/platforms/dbt/insights/checks/check_macro_has_desc.py +63 -0
- datapilot/core/platforms/dbt/insights/checks/check_model_has_all_columns.py +96 -0
- datapilot/core/platforms/dbt/insights/checks/check_model_has_labels_keys.py +112 -0
- datapilot/core/platforms/dbt/insights/checks/check_model_has_meta_keys.py +108 -0
- datapilot/core/platforms/dbt/insights/checks/check_model_has_properties_file.py +64 -0
- datapilot/core/platforms/dbt/insights/checks/check_model_has_tests_by_group.py +118 -0
- datapilot/core/platforms/dbt/insights/checks/check_model_has_tests_by_name.py +114 -0
- datapilot/core/platforms/dbt/insights/checks/check_model_has_tests_by_type.py +119 -0
- datapilot/core/platforms/dbt/insights/checks/check_model_materialization_by_childs.py +129 -0
- datapilot/core/platforms/dbt/insights/checks/check_model_name_contract.py +132 -0
- datapilot/core/platforms/dbt/insights/checks/check_model_parents_and_childs.py +135 -0
- datapilot/core/platforms/dbt/insights/checks/check_model_parents_database.py +109 -0
- datapilot/core/platforms/dbt/insights/checks/check_model_parents_schema.py +109 -0
- datapilot/core/platforms/dbt/insights/checks/check_model_tags.py +87 -0
- datapilot/core/platforms/dbt/insights/checks/check_source_childs.py +97 -0
- datapilot/core/platforms/dbt/insights/checks/check_source_columns_have_desc.py +96 -0
- datapilot/core/platforms/dbt/insights/checks/check_source_has_all_columns.py +103 -0
- datapilot/core/platforms/dbt/insights/checks/check_source_has_freshness.py +94 -0
- datapilot/core/platforms/dbt/insights/checks/check_source_has_labels_keys.py +110 -0
- datapilot/core/platforms/dbt/insights/checks/check_source_has_loader.py +62 -0
- datapilot/core/platforms/dbt/insights/checks/check_source_has_meta_keys.py +117 -0
- datapilot/core/platforms/dbt/insights/checks/check_source_has_tests.py +82 -0
- datapilot/core/platforms/dbt/insights/checks/check_source_has_tests_by_group.py +117 -0
- datapilot/core/platforms/dbt/insights/checks/check_source_has_tests_by_name.py +113 -0
- datapilot/core/platforms/dbt/insights/checks/check_source_has_tests_by_type.py +119 -0
- datapilot/core/platforms/dbt/insights/checks/check_source_table_has_description.py +62 -0
- datapilot/core/platforms/dbt/insights/checks/check_source_tags.py +76 -0
- datapilot/core/platforms/dbt/insights/dbt_test/__init__.py +0 -0
- datapilot/core/platforms/dbt/insights/dbt_test/base.py +23 -0
- datapilot/core/platforms/dbt/insights/dbt_test/missing_primary_key_tests.py +130 -0
- datapilot/core/platforms/dbt/insights/dbt_test/test_coverage.py +118 -0
- datapilot/core/platforms/dbt/insights/governance/__init__.py +0 -0
- datapilot/core/platforms/dbt/insights/governance/base.py +23 -0
- datapilot/core/platforms/dbt/insights/governance/documentation_on_stale_columns.py +130 -0
- datapilot/core/platforms/dbt/insights/governance/exposures_dependent_on_private_models.py +90 -0
- datapilot/core/platforms/dbt/insights/governance/public_models_without_contracts.py +89 -0
- datapilot/core/platforms/dbt/insights/governance/undocumented_columns.py +148 -0
- datapilot/core/platforms/dbt/insights/governance/undocumented_public_models.py +110 -0
- datapilot/core/platforms/dbt/insights/modelling/README.md +15 -0
- datapilot/core/platforms/dbt/insights/modelling/__init__.py +0 -0
- datapilot/core/platforms/dbt/insights/modelling/base.py +31 -0
- datapilot/core/platforms/dbt/insights/modelling/direct_join_to_source.py +125 -0
- datapilot/core/platforms/dbt/insights/modelling/downstream_models_dependent_on_source.py +113 -0
- datapilot/core/platforms/dbt/insights/modelling/duplicate_sources.py +85 -0
- datapilot/core/platforms/dbt/insights/modelling/hard_coded_references.py +80 -0
- datapilot/core/platforms/dbt/insights/modelling/joining_of_upstream_concepts.py +79 -0
- datapilot/core/platforms/dbt/insights/modelling/model_fanout.py +126 -0
- datapilot/core/platforms/dbt/insights/modelling/multiple_sources_joined.py +83 -0
- datapilot/core/platforms/dbt/insights/modelling/root_model.py +82 -0
- datapilot/core/platforms/dbt/insights/modelling/source_fanout.py +102 -0
- datapilot/core/platforms/dbt/insights/modelling/staging_model_dependent_on_downstream_models.py +103 -0
- datapilot/core/platforms/dbt/insights/modelling/staging_model_dependent_on_staging_models.py +89 -0
- datapilot/core/platforms/dbt/insights/modelling/unused_sources.py +59 -0
- datapilot/core/platforms/dbt/insights/performance/__init__.py +0 -0
- datapilot/core/platforms/dbt/insights/performance/base.py +26 -0
- datapilot/core/platforms/dbt/insights/performance/chain_view_linking.py +92 -0
- datapilot/core/platforms/dbt/insights/performance/exposure_parent_materializations.py +104 -0
- datapilot/core/platforms/dbt/insights/schema.py +72 -0
- datapilot/core/platforms/dbt/insights/structure/__init__.py +0 -0
- datapilot/core/platforms/dbt/insights/structure/base.py +33 -0
- datapilot/core/platforms/dbt/insights/structure/model_directories_structure.py +92 -0
- datapilot/core/platforms/dbt/insights/structure/model_naming_conventions.py +97 -0
- datapilot/core/platforms/dbt/insights/structure/source_directories_structure.py +80 -0
- datapilot/core/platforms/dbt/insights/structure/test_directory_structure.py +74 -0
- datapilot/core/platforms/dbt/insights/utils.py +9 -0
- datapilot/core/platforms/dbt/schemas/__init__.py +0 -0
- datapilot/core/platforms/dbt/schemas/catalog.py +73 -0
- datapilot/core/platforms/dbt/schemas/manifest.py +462 -0
- datapilot/core/platforms/dbt/utils.py +525 -0
- datapilot/core/platforms/dbt/wrappers/__init__.py +0 -0
- datapilot/core/platforms/dbt/wrappers/catalog/__init__.py +0 -0
- datapilot/core/platforms/dbt/wrappers/catalog/v1/__init__.py +0 -0
- datapilot/core/platforms/dbt/wrappers/catalog/v1/wrapper.py +18 -0
- datapilot/core/platforms/dbt/wrappers/catalog/wrapper.py +9 -0
- datapilot/core/platforms/dbt/wrappers/manifest/__init__.py +0 -0
- datapilot/core/platforms/dbt/wrappers/manifest/v11/__init__.py +0 -0
- datapilot/core/platforms/dbt/wrappers/manifest/v11/schemas.py +47 -0
- datapilot/core/platforms/dbt/wrappers/manifest/v11/wrapper.py +396 -0
- datapilot/core/platforms/dbt/wrappers/manifest/wrapper.py +35 -0
- datapilot/core/platforms/dbt/wrappers/run_results/__init__.py +0 -0
- datapilot/core/platforms/dbt/wrappers/run_results/run_results.py +39 -0
- datapilot/exceptions/__init__.py +0 -0
- datapilot/exceptions/exceptions.py +10 -0
- datapilot/schemas/__init__.py +0 -0
- datapilot/schemas/constants.py +5 -0
- datapilot/schemas/nodes.py +19 -0
- datapilot/schemas/sql.py +10 -0
- datapilot/utils/__init__.py +0 -0
- datapilot/utils/formatting/__init__.py +0 -0
- datapilot/utils/formatting/utils.py +59 -0
- datapilot/utils/utils.py +317 -0
@@ -0,0 +1,9 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2024, Anand Gupta
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
6
|
+
|
7
|
+
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
|
8
|
+
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,102 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: altimate-datapilot-cli
|
3
|
+
Version: 0.0.8
|
4
|
+
Summary: Assistant for Data Teams
|
5
|
+
Home-page: https://github.com/AltimateAI/datapilot
|
6
|
+
Author: Anand Gupta
|
7
|
+
Author-email: info@altimate.ai
|
8
|
+
License: MIT
|
9
|
+
Project-URL: Documentation, https://datapilot.readthedocs.io/
|
10
|
+
Project-URL: Changelog, https://datapilot.readthedocs.io/en/latest/changelog.html
|
11
|
+
Project-URL: Issue Tracker, https://github.com/AltimateAI/datapilot/issues
|
12
|
+
Platform: UNKNOWN
|
13
|
+
Classifier: Development Status :: 5 - Production/Stable
|
14
|
+
Classifier: Intended Audience :: Developers
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
16
|
+
Classifier: Operating System :: Unix
|
17
|
+
Classifier: Operating System :: POSIX
|
18
|
+
Classifier: Operating System :: Microsoft :: Windows
|
19
|
+
Classifier: Programming Language :: Python
|
20
|
+
Classifier: Programming Language :: Python :: 3
|
21
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
22
|
+
Classifier: Programming Language :: Python :: 3.8
|
23
|
+
Classifier: Programming Language :: Python :: 3.9
|
24
|
+
Classifier: Programming Language :: Python :: 3.10
|
25
|
+
Classifier: Programming Language :: Python :: 3.11
|
26
|
+
Classifier: Programming Language :: Python :: 3.12
|
27
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
28
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
29
|
+
Classifier: Topic :: Utilities
|
30
|
+
Requires-Python: >=3.8
|
31
|
+
License-File: LICENSE
|
32
|
+
License-File: AUTHORS.rst
|
33
|
+
Requires-Dist: click (==8.1.7)
|
34
|
+
Requires-Dist: sqlglot (==18.3.0)
|
35
|
+
Requires-Dist: dbt-artifacts-parser (==0.5.1)
|
36
|
+
Requires-Dist: ruamel.yaml (==0.18.6)
|
37
|
+
Requires-Dist: tabulate (==0.9.0)
|
38
|
+
Requires-Dist: requests (==2.31.0)
|
39
|
+
|
40
|
+
========
|
41
|
+
Overview
|
42
|
+
========
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
Assistant for Data Teams
|
47
|
+
|
48
|
+
* Free software: MIT license
|
49
|
+
|
50
|
+
Installation
|
51
|
+
============
|
52
|
+
|
53
|
+
::
|
54
|
+
|
55
|
+
pip install altimate-datapilot-cli
|
56
|
+
|
57
|
+
You can also install the in-development version with::
|
58
|
+
|
59
|
+
pip install https://github.com/AltimateAI/datapilot/archive/main.zip
|
60
|
+
|
61
|
+
|
62
|
+
Documentation
|
63
|
+
=============
|
64
|
+
|
65
|
+
|
66
|
+
https://datapilot.readthedocs.io/
|
67
|
+
|
68
|
+
|
69
|
+
Development
|
70
|
+
===========
|
71
|
+
|
72
|
+
To run all the tests run::
|
73
|
+
|
74
|
+
tox
|
75
|
+
|
76
|
+
Note, to combine the coverage data from all the tox environments run:
|
77
|
+
|
78
|
+
.. list-table::
|
79
|
+
:widths: 10 90
|
80
|
+
:stub-columns: 1
|
81
|
+
|
82
|
+
- - Windows
|
83
|
+
- ::
|
84
|
+
|
85
|
+
set PYTEST_ADDOPTS=--cov-append
|
86
|
+
tox
|
87
|
+
|
88
|
+
- - Other
|
89
|
+
- ::
|
90
|
+
|
91
|
+
PYTEST_ADDOPTS=--cov-append tox
|
92
|
+
|
93
|
+
|
94
|
+
Changelog
|
95
|
+
=========
|
96
|
+
|
97
|
+
0.0.0 (2024-01-25)
|
98
|
+
------------------
|
99
|
+
|
100
|
+
* First release on PyPI.
|
101
|
+
|
102
|
+
|
@@ -0,0 +1,139 @@
|
|
1
|
+
datapilot/__init__.py,sha256=wOJN3HxAgnSon5vWYU3Txm2UZ_7tBHDKXUKZIH-mXX8,22
|
2
|
+
datapilot/__main__.py,sha256=I9USmeNnK-cAHb6LZfydJC0LeNSE8enieeY55wpR6uw,380
|
3
|
+
datapilot/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
|
+
datapilot/cli/main.py,sha256=VSdqlkCiu8GSG9qQh8q0BzyocsQc4lKWxZAPEsjXF18,181
|
5
|
+
datapilot/clients/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
+
datapilot/clients/altimate/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
|
+
datapilot/clients/altimate/client.py,sha256=ayTvegsQKOj0EocIWeB03ys1PlGLJFB5k8zDs8oxPBo,3107
|
8
|
+
datapilot/clients/altimate/utils.py,sha256=cDYR-6J4SDaOBMOtkOlaP_j0TkCgCyYLFVDjVCEiCLY,2629
|
9
|
+
datapilot/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
10
|
+
datapilot/config/config.py,sha256=kyj53Qsb85V4iGQsX0vSwULOjscMOSFrJDJ3tnagJpo,403
|
11
|
+
datapilot/config/utils.py,sha256=DIAVX-OZ5Lc0Ky_A7dvdbPcD1QSg2DRxZcuaIIZ2rhw,1146
|
12
|
+
datapilot/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
13
|
+
datapilot/core/insights/__init__.py,sha256=39zN2cGQCsEjRFeExv2bX4MoqVv4H14o_SYp_QG2jHU,18
|
14
|
+
datapilot/core/insights/report.py,sha256=acAK-RSV6Q2nplkrzFNUAYaq6RcLRikAi_Qya-rMOf8,596
|
15
|
+
datapilot/core/insights/schema.py,sha256=c0dCcjuB33CZNALwk1GV9o_ccxQBOoyqM4S7w7zpnxs,413
|
16
|
+
datapilot/core/insights/utils.py,sha256=W4-B3SSI0jij3eAEWXdzVs5WScXlmC1hdwxKIb-2FrU,535
|
17
|
+
datapilot/core/insights/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
18
|
+
datapilot/core/insights/base/insight.py,sha256=AshjeLhV7cxwYANfSidDfHZssifTmvymkGHcWkeKipk,883
|
19
|
+
datapilot/core/insights/sql/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
20
|
+
datapilot/core/insights/sql/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
21
|
+
datapilot/core/insights/sql/base/insight.py,sha256=fU7Pm7AkytlafCROEIFY1mDvLf31V_hkNlL5Gy45v4M,471
|
22
|
+
datapilot/core/insights/sql/runtime/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
23
|
+
datapilot/core/insights/sql/static/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
24
|
+
datapilot/core/platforms/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
25
|
+
datapilot/core/platforms/dbt/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
26
|
+
datapilot/core/platforms/dbt/constants.py,sha256=N9Ovo9100iOAeRu8pPZLYg3_11O5QKgs3dW0VMU6jR8,502
|
27
|
+
datapilot/core/platforms/dbt/exceptions.py,sha256=IC5BgcU90gjYYwPcfTlPNtn0_p8fYjavDRMpKZQ0OnY,110
|
28
|
+
datapilot/core/platforms/dbt/executor.py,sha256=hvdh0qJjalWJN8ElJjIUvUiLrMIcvGvoQfrysMTqa-Y,6562
|
29
|
+
datapilot/core/platforms/dbt/factory.py,sha256=ZD6alSxbBqXr95tpf4onjd_UVZ4RHp4YXbc0hvbbbOs,1095
|
30
|
+
datapilot/core/platforms/dbt/formatting.py,sha256=bpfa7XmVghTq4WnGDGYC6DruwOwH8YmjFHghoo5cPD8,1638
|
31
|
+
datapilot/core/platforms/dbt/utils.py,sha256=ozFHprR6LTLXQdrGyaRoyIBTua4P1NkP8T7LGgN-9c0,18577
|
32
|
+
datapilot/core/platforms/dbt/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
33
|
+
datapilot/core/platforms/dbt/cli/cli.py,sha256=sEPOoYL7lVy4G5Y4HNi6yeQqMtknxIh1EzobiisBL6c,4146
|
34
|
+
datapilot/core/platforms/dbt/hooks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
35
|
+
datapilot/core/platforms/dbt/hooks/executor_hook.py,sha256=gSM50vAO7C-f1rdnHogWbqc87aCXPXysZepjp5L2qzw,2966
|
36
|
+
datapilot/core/platforms/dbt/insights/__init__.py,sha256=vnNOqP6lJ-r1SqmxQbeTEphL-omj466OanqQY1WNrUA,7547
|
37
|
+
datapilot/core/platforms/dbt/insights/base.py,sha256=XA4hAUf0wfTId0p7gEdBRfz1puNGh_6rRw_YV3rjMEI,5260
|
38
|
+
datapilot/core/platforms/dbt/insights/schema.py,sha256=4nPxEGsgN5sCXQ1BrOesTRphkMKZj1szyk6ckoz49eg,2657
|
39
|
+
datapilot/core/platforms/dbt/insights/utils.py,sha256=2btHwxzxEm7cjoLSzzbnZ3q3caI-58NJeWM0_TouJhI,267
|
40
|
+
datapilot/core/platforms/dbt/insights/checks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
41
|
+
datapilot/core/platforms/dbt/insights/checks/base.py,sha256=by5-YHNzBnppS6xQq0bTUaEGGtg69OPbrrnffXpC30Y,824
|
42
|
+
datapilot/core/platforms/dbt/insights/checks/check_column_desc_are_same.py,sha256=Vo8wRsm7O0VOqJIVgLYtTINyb01KWYbN6yg4GT-Vafk,4609
|
43
|
+
datapilot/core/platforms/dbt/insights/checks/check_column_name_contract.py,sha256=pud7QEpMVYDcR2l-ATX18OKyRC3eAlbNdhfEzHR4T-g,7222
|
44
|
+
datapilot/core/platforms/dbt/insights/checks/check_macro_args_have_desc.py,sha256=Px-gBR0dx9z-xLOcp2ctDuKMRKK4ai554woMpeBFGFs,3185
|
45
|
+
datapilot/core/platforms/dbt/insights/checks/check_macro_has_desc.py,sha256=UrMYyZpi97gIBvH7leu5z27BowaFfPl0tOI4dqMSJmQ,2802
|
46
|
+
datapilot/core/platforms/dbt/insights/checks/check_model_has_all_columns.py,sha256=LULWYrGHrXiEcFfv5VxbrQ3quw4h5mLn3Sd_pG4ayug,4277
|
47
|
+
datapilot/core/platforms/dbt/insights/checks/check_model_has_labels_keys.py,sha256=ZaIRC8Euq5kpF8JI8SFOqauSR_PWmYAXHCmd1-1oVD8,5183
|
48
|
+
datapilot/core/platforms/dbt/insights/checks/check_model_has_meta_keys.py,sha256=r_GsGvQCAfcZBl8fbzw4T9jccbxwqlCoMeMnoX8jSXw,5016
|
49
|
+
datapilot/core/platforms/dbt/insights/checks/check_model_has_properties_file.py,sha256=hyl51rqSGmbj5DINtL5Dvex80SGSmN2o-qf_U6eaNMg,2968
|
50
|
+
datapilot/core/platforms/dbt/insights/checks/check_model_has_tests_by_group.py,sha256=d2Csu6EAapFx6eIXuCaCdNllbsjIBVab5QmlIv-SqGM,5706
|
51
|
+
datapilot/core/platforms/dbt/insights/checks/check_model_has_tests_by_name.py,sha256=bu87eQ5yZYZHtmdMEoIUA1Ynv8Tw3UGwCYKB_1_AXDI,5187
|
52
|
+
datapilot/core/platforms/dbt/insights/checks/check_model_has_tests_by_type.py,sha256=_m9G4GhhNtl-ShWpODlxuzz61eFLxG_Bw-RDW2nKOFI,5590
|
53
|
+
datapilot/core/platforms/dbt/insights/checks/check_model_materialization_by_childs.py,sha256=PKAcmRGRkpqk_CK80So-A5VRuhTImkHmxbFYpHr83Ng,6098
|
54
|
+
datapilot/core/platforms/dbt/insights/checks/check_model_name_contract.py,sha256=cpFX4_XuwcJRY1VR9oho9PygCGxVPbruCXWDPG8yfik,6037
|
55
|
+
datapilot/core/platforms/dbt/insights/checks/check_model_parents_and_childs.py,sha256=JRCypUTEHbcAH7p7OWQxNdiFfxrIDWzr5Q8XhIqEofE,6319
|
56
|
+
datapilot/core/platforms/dbt/insights/checks/check_model_parents_database.py,sha256=RzvsLMiy6SFqNsHiUa_64nw-JSwyXOnJ_yWkA8KsiUg,4665
|
57
|
+
datapilot/core/platforms/dbt/insights/checks/check_model_parents_schema.py,sha256=7o08KynfjWaPZ1kAKkBCSHGEJekRtUF8E6RNqBEi2AA,4658
|
58
|
+
datapilot/core/platforms/dbt/insights/checks/check_model_tags.py,sha256=-268fA2kq4du6bhC77K6KSR9GaScObbsm5SRbPSd7To,3555
|
59
|
+
datapilot/core/platforms/dbt/insights/checks/check_source_childs.py,sha256=L8W66Hauwjg98OCE3NFfTzXIbmT0XehD2TysiaPe-Eo,4254
|
60
|
+
datapilot/core/platforms/dbt/insights/checks/check_source_columns_have_desc.py,sha256=UzohMY6PGH_d-VCVJxvAbDI_DqeQqukmCpKU9W9fk_g,4453
|
61
|
+
datapilot/core/platforms/dbt/insights/checks/check_source_has_all_columns.py,sha256=AkAyNas0_dl7EN-hZitN33nTaAM11zsNvlGJjLnZOd0,4650
|
62
|
+
datapilot/core/platforms/dbt/insights/checks/check_source_has_freshness.py,sha256=CFT_2uYghd_Aak6EOkwQMyauzebVTskBMYmjLZPZlr4,4111
|
63
|
+
datapilot/core/platforms/dbt/insights/checks/check_source_has_labels_keys.py,sha256=l8uKIdg-CCgC-w4-Ay_UTdNlAkrRlTY1Aw8G4pFvAXs,5256
|
64
|
+
datapilot/core/platforms/dbt/insights/checks/check_source_has_loader.py,sha256=d3KixZeAVTlcKl8t-ap2n7pZU0qXDBeXYzjf813GkEE,2772
|
65
|
+
datapilot/core/platforms/dbt/insights/checks/check_source_has_meta_keys.py,sha256=omzKNdBAYYwggt36Jz4BzaOnDqVRL1mJee0xNtYsKSo,5246
|
66
|
+
datapilot/core/platforms/dbt/insights/checks/check_source_has_tests.py,sha256=M7WWX1ud49FnInS_htvmNa_8gIjVuhk9tIuq7Q-4P5E,3711
|
67
|
+
datapilot/core/platforms/dbt/insights/checks/check_source_has_tests_by_group.py,sha256=tvflQTxgdejTecDBspD6PdLLDHIWXY-_4uOzPWWqh2w,5550
|
68
|
+
datapilot/core/platforms/dbt/insights/checks/check_source_has_tests_by_name.py,sha256=wDNYB0ZGx_hV8DxXewR1TtZ_HnozZN1Dyk0YOlGUoEs,5159
|
69
|
+
datapilot/core/platforms/dbt/insights/checks/check_source_has_tests_by_type.py,sha256=LAAr9gwwFX1oSPFGzTPlGCva45rwtDA5U5tqL7xrVZk,5566
|
70
|
+
datapilot/core/platforms/dbt/insights/checks/check_source_table_has_description.py,sha256=UX2QfGgB3sH2JEtpXpfVfOd_Lnhka70LwpToHuTXYIc,2852
|
71
|
+
datapilot/core/platforms/dbt/insights/checks/check_source_tags.py,sha256=YeBiJL8TTgwUteHdq67-VLu1I2wKC2bx0H0bbEa2DLE,3117
|
72
|
+
datapilot/core/platforms/dbt/insights/dbt_test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
73
|
+
datapilot/core/platforms/dbt/insights/dbt_test/base.py,sha256=LKYSyOcY6FwHmd2Lls2MU97SLHgYjvWocQs9K9_HYhg,739
|
74
|
+
datapilot/core/platforms/dbt/insights/dbt_test/missing_primary_key_tests.py,sha256=H7gWydnf5xrBFifp4v1AZo4KmLAw3ABCLnirOrvS66M,5672
|
75
|
+
datapilot/core/platforms/dbt/insights/dbt_test/test_coverage.py,sha256=R06ttqQ9fYLsgQz99MdFQMoOcCHV4TLL697CqdPeXRY,5216
|
76
|
+
datapilot/core/platforms/dbt/insights/governance/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
77
|
+
datapilot/core/platforms/dbt/insights/governance/base.py,sha256=oLYu3bgvKO2KUCqbWxFbRncUqiqXWG8v5LDZVR_K4XM,743
|
78
|
+
datapilot/core/platforms/dbt/insights/governance/documentation_on_stale_columns.py,sha256=Mlj2MnYlZiNpjSF14eNVojQBAcasDIdt-0PEj4vePx8,5718
|
79
|
+
datapilot/core/platforms/dbt/insights/governance/exposures_dependent_on_private_models.py,sha256=eP-UioYdX0wsU1GKPJdDu3HGt37LAJui6hYc8i9Vieo,4306
|
80
|
+
datapilot/core/platforms/dbt/insights/governance/public_models_without_contracts.py,sha256=s2oorfsnsosUeVkb5w_kdpqoZUxY5OIT6FTGIN0wyT0,4100
|
81
|
+
datapilot/core/platforms/dbt/insights/governance/undocumented_columns.py,sha256=TOTX1J2xi3aMissd8cFcPcK-MrOUpFUXuaOXqLRypJ0,6394
|
82
|
+
datapilot/core/platforms/dbt/insights/governance/undocumented_public_models.py,sha256=MqIgtQtewQAW7MDCRPpKgEID0D_kF8b_7YM1WvorY_g,5092
|
83
|
+
datapilot/core/platforms/dbt/insights/modelling/README.md,sha256=tBXGpa5lTGy56D3OGLmji9Gp3AbfIRoFnBSKA0uB4Gc,419
|
84
|
+
datapilot/core/platforms/dbt/insights/modelling/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
85
|
+
datapilot/core/platforms/dbt/insights/modelling/base.py,sha256=yCCXgkM-jTff2cuhdOjINGyu0iW2FhGP5jgQMfTOBik,1009
|
86
|
+
datapilot/core/platforms/dbt/insights/modelling/direct_join_to_source.py,sha256=Q47iYa1tO8J3KLciIjk21E2Hp2Gz12pDgcVMlf1J4JU,6585
|
87
|
+
datapilot/core/platforms/dbt/insights/modelling/downstream_models_dependent_on_source.py,sha256=dlutPoYjBXey-fDBb_aJ8B_c0cHfFzkFG1FhcZbJ4Fk,5790
|
88
|
+
datapilot/core/platforms/dbt/insights/modelling/duplicate_sources.py,sha256=uEn_vNx8EhWnUNaRClXkQqcWr1qOSeA79ZuQSZ1Y6TM,3937
|
89
|
+
datapilot/core/platforms/dbt/insights/modelling/hard_coded_references.py,sha256=dOx66y0dwOm6lUo_pU5WiBfyV1ZMs8CfgFpp_XX9UVk,3671
|
90
|
+
datapilot/core/platforms/dbt/insights/modelling/joining_of_upstream_concepts.py,sha256=JApYcSsJ86-Ix-fdUXDQuYxlkyuHlou4XHRHc6bSsIM,3937
|
91
|
+
datapilot/core/platforms/dbt/insights/modelling/model_fanout.py,sha256=LQj1nMzhPgblZznBv0MQSLCVn8XWBtfnEvVhMYyDsTU,5223
|
92
|
+
datapilot/core/platforms/dbt/insights/modelling/multiple_sources_joined.py,sha256=A8il-Rns0DWF0CJrV2PLD3vBkdk4h88KU_0rPdbOTDw,3753
|
93
|
+
datapilot/core/platforms/dbt/insights/modelling/root_model.py,sha256=rtQ4fDCMrZOtfv-d3EjhSeOj1KkCB-rK2xYObC5-ynI,3993
|
94
|
+
datapilot/core/platforms/dbt/insights/modelling/source_fanout.py,sha256=wmgdRIQzuoP1-Bfj5RbsidiZHdAhqWQj1J-oAQS-SvY,4550
|
95
|
+
datapilot/core/platforms/dbt/insights/modelling/staging_model_dependent_on_downstream_models.py,sha256=kbQpIx_hyq8LoYwlP3Z_pAXM0pnPxyYoFaBWCBCg6kQ,4976
|
96
|
+
datapilot/core/platforms/dbt/insights/modelling/staging_model_dependent_on_staging_models.py,sha256=qunco_Kz9Z2bblNv-8M0hm5q-hccceMpubniV43jCe4,4261
|
97
|
+
datapilot/core/platforms/dbt/insights/modelling/unused_sources.py,sha256=fS8YC47fb55XuVK8VpxUJ020d5Oh7MSGx6LSplR5aNs,2780
|
98
|
+
datapilot/core/platforms/dbt/insights/performance/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
99
|
+
datapilot/core/platforms/dbt/insights/performance/base.py,sha256=4EE7WmwlqMQSmBcpYeZrellvGU87F81cTL5wxBV5QSo,829
|
100
|
+
datapilot/core/platforms/dbt/insights/performance/chain_view_linking.py,sha256=gqL4qqNAybOTYhc9VGlrbQQJ1PkDtBHFKrcQi_XRpTM,3627
|
101
|
+
datapilot/core/platforms/dbt/insights/performance/exposure_parent_materializations.py,sha256=bX7yqls9eMHShXeNdZ8J3IefM3Gp-4D9OGXAYfrKHEs,4689
|
102
|
+
datapilot/core/platforms/dbt/insights/structure/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
103
|
+
datapilot/core/platforms/dbt/insights/structure/base.py,sha256=sekRrLxB8IvpCzxShPC1L71K36XjsRMJyXzGRz4TcGQ,1101
|
104
|
+
datapilot/core/platforms/dbt/insights/structure/model_directories_structure.py,sha256=NdsXojyRpVv0-jhUWdxg6uvEa0EInT_RR8DYaAsRXKQ,4382
|
105
|
+
datapilot/core/platforms/dbt/insights/structure/model_naming_conventions.py,sha256=3_kMFQygPQQKtcrt2HIizDpu3wmucymI3xVoxQHx0Sk,4999
|
106
|
+
datapilot/core/platforms/dbt/insights/structure/source_directories_structure.py,sha256=K-xTjYltuzcHH51s6PbFYcrnqpSCYluTbrzW1JT_vIU,3675
|
107
|
+
datapilot/core/platforms/dbt/insights/structure/test_directory_structure.py,sha256=XL6YQgWmf397W2OwBmT7L8zUN93M1bOZBTp4PlngqlI,3484
|
108
|
+
datapilot/core/platforms/dbt/schemas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
109
|
+
datapilot/core/platforms/dbt/schemas/catalog.py,sha256=izhzchuME5BTuNAj6iyDHpo6NAPsggG4rd6z6WxOWV8,1878
|
110
|
+
datapilot/core/platforms/dbt/schemas/manifest.py,sha256=8d8ZNpPIhQSNwh32PodHbzW-iucAvDSYBSnwbJRlEcY,14117
|
111
|
+
datapilot/core/platforms/dbt/wrappers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
112
|
+
datapilot/core/platforms/dbt/wrappers/catalog/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
113
|
+
datapilot/core/platforms/dbt/wrappers/catalog/wrapper.py,sha256=LDjt4pSiqGAmvI5DSPzEubwq13N1MKv9xakLNhG-BWY,196
|
114
|
+
datapilot/core/platforms/dbt/wrappers/catalog/v1/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
115
|
+
datapilot/core/platforms/dbt/wrappers/catalog/v1/wrapper.py,sha256=OHCxG0CJAxOgicGeykoJJ3AnJG8izZvDUGNm7pXajRQ,832
|
116
|
+
datapilot/core/platforms/dbt/wrappers/manifest/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
117
|
+
datapilot/core/platforms/dbt/wrappers/manifest/wrapper.py,sha256=lKFpmgALDqMEXQldkQ9OFjG51VAfTcZ7rk01e2t39n0,1078
|
118
|
+
datapilot/core/platforms/dbt/wrappers/manifest/v11/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
119
|
+
datapilot/core/platforms/dbt/wrappers/manifest/v11/schemas.py,sha256=Mb0N48czcwQTz5mxQx2QlVINzz50A5FUm0kMJ-Nzs6A,1523
|
120
|
+
datapilot/core/platforms/dbt/wrappers/manifest/v11/wrapper.py,sha256=WxHRwu3E_8-YHrcoI-5EisUi4uVQ6przB9SVHBnfLEg,17274
|
121
|
+
datapilot/core/platforms/dbt/wrappers/run_results/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
122
|
+
datapilot/core/platforms/dbt/wrappers/run_results/run_results.py,sha256=3E_y1gAF491WmXt-Z_Fqhr5BU-kVnzjHpZZv5UpOx-s,1267
|
123
|
+
datapilot/exceptions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
124
|
+
datapilot/exceptions/exceptions.py,sha256=iFHI9_LVRlHo0fe9Zjv6QKCqjTkRJ0K5n_97AUOpFvs,162
|
125
|
+
datapilot/schemas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
126
|
+
datapilot/schemas/constants.py,sha256=-eyLQvpB3ut2cQ8Cx-xGpCa9lOHBUATA8s-FXEkBoFQ,190
|
127
|
+
datapilot/schemas/nodes.py,sha256=bm2ui0rx46UTzlI-Fbvh0BkGWNqnUBPBz-uNL5XAzPI,319
|
128
|
+
datapilot/schemas/sql.py,sha256=swvQKX0E2t9K48zB7NiqmPl8yZgfzILMHwBdzAwe1hQ,193
|
129
|
+
datapilot/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
130
|
+
datapilot/utils/utils.py,sha256=XGi0jn030M2Cp_WJ-cIOZzdzRewEOQrPldzcaDj7uPw,11150
|
131
|
+
datapilot/utils/formatting/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
132
|
+
datapilot/utils/formatting/utils.py,sha256=rAVmIYuldvw9VvCSwG2kMTEgiT7cEconp_F1sAWVyCo,1377
|
133
|
+
altimate_datapilot_cli-0.0.8.dist-info/AUTHORS.rst,sha256=S4H4zw_v3GVyz5_55jF5Gf_YNG3s5Y0VgbQaEov9PFk,50
|
134
|
+
altimate_datapilot_cli-0.0.8.dist-info/LICENSE,sha256=Mf7VqpsmU2QR5_s2Cb_ZeeMB2Q9KW7YXJENZPFZRK1k,1100
|
135
|
+
altimate_datapilot_cli-0.0.8.dist-info/METADATA,sha256=ogb9-SqtGxlIOvFLIRP99d3usxS-6SEZ65TygNAyjts,2385
|
136
|
+
altimate_datapilot_cli-0.0.8.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
137
|
+
altimate_datapilot_cli-0.0.8.dist-info/entry_points.txt,sha256=0zwgKxN40RLVB5jSmlJz7IH_FBqRtpFdbrdZn-xuQIY,141
|
138
|
+
altimate_datapilot_cli-0.0.8.dist-info/top_level.txt,sha256=gAOFOdwB00vcxv74y4M1J-nQtPvEatU8-mYViEBcToo,10
|
139
|
+
altimate_datapilot_cli-0.0.8.dist-info/RECORD,,
|
@@ -0,0 +1 @@
|
|
1
|
+
datapilot
|
datapilot/__init__.py
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "0.0.8"
|
datapilot/__main__.py
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
"""
|
2
|
+
Entrypoint module, in case you use `python -mdatapilot`.
|
3
|
+
|
4
|
+
|
5
|
+
Why does this file exist, and why __main__? For more info, read:
|
6
|
+
|
7
|
+
- https://www.python.org/dev/peps/pep-0338/
|
8
|
+
- https://docs.python.org/2/using/cmdline.html#cmdoption-m
|
9
|
+
- https://docs.python.org/3/using/cmdline.html#cmdoption-m
|
10
|
+
"""
|
11
|
+
from datapilot.cli.main import datapilot
|
12
|
+
|
13
|
+
if __name__ == "__main__":
|
14
|
+
datapilot()
|
File without changes
|
datapilot/cli/main.py
ADDED
File without changes
|
File without changes
|
@@ -0,0 +1,85 @@
|
|
1
|
+
import logging
|
2
|
+
|
3
|
+
import requests
|
4
|
+
from requests.exceptions import ConnectionError
|
5
|
+
from requests.exceptions import HTTPError
|
6
|
+
from requests.exceptions import RequestException
|
7
|
+
from requests.exceptions import Timeout
|
8
|
+
|
9
|
+
|
10
|
+
class APIClient:
|
11
|
+
def __init__(self, api_token="", base_url="", tenant=""):
|
12
|
+
self.api_token = api_token
|
13
|
+
self.base_url = base_url
|
14
|
+
self.tenant = tenant
|
15
|
+
self.logger = logging.getLogger(self.__class__.__name__)
|
16
|
+
|
17
|
+
def _get_headers(self):
|
18
|
+
headers = {
|
19
|
+
"Content-Type": "application/json",
|
20
|
+
}
|
21
|
+
|
22
|
+
if self.api_token:
|
23
|
+
headers["Authorization"] = f"Bearer {self.api_token}"
|
24
|
+
|
25
|
+
if self.tenant:
|
26
|
+
headers["x-tenant"] = self.tenant
|
27
|
+
|
28
|
+
return headers
|
29
|
+
|
30
|
+
def log(self, message):
|
31
|
+
self.logger.debug(message)
|
32
|
+
|
33
|
+
def get(self, endpoint, params=None, timeout=None):
|
34
|
+
url = f"{self.base_url}{endpoint}"
|
35
|
+
headers = self._get_headers()
|
36
|
+
|
37
|
+
try:
|
38
|
+
self.logger.debug(f"Sending GET request for tenant {self.tenant} at url: {url}")
|
39
|
+
response = requests.get(url, headers=headers, params=params, timeout=timeout)
|
40
|
+
|
41
|
+
# Check if the response was successful
|
42
|
+
response.raise_for_status()
|
43
|
+
self.logger.debug(f"Received GET response with status: {response.status_code}")
|
44
|
+
return response.json()
|
45
|
+
|
46
|
+
except HTTPError as http_err:
|
47
|
+
self.logger.error(f"{http_err.response.json()} - Status code: {response.status_code}")
|
48
|
+
except ConnectionError as conn_err:
|
49
|
+
self.logger.error(f"Connection error occurred: {conn_err}")
|
50
|
+
except Timeout as timeout_err:
|
51
|
+
self.logger.error(f"Timeout error occurred: {timeout_err}")
|
52
|
+
except RequestException as req_err:
|
53
|
+
self.logger.error(f"Unexpected error occurred: {req_err}")
|
54
|
+
except Exception as err:
|
55
|
+
self.logger.error(f"An error occurred: {err}")
|
56
|
+
|
57
|
+
def post(self, endpoint, data=None, timeout=None):
|
58
|
+
url = f"{self.base_url}{endpoint}"
|
59
|
+
headers = self._get_headers()
|
60
|
+
|
61
|
+
self.logger.debug(f"Sending POST request for tenant {self.tenant} at url: {url}")
|
62
|
+
response = requests.post(url, headers=headers, json=data, timeout=timeout)
|
63
|
+
self.logger.debug(f"Received POST response with status: {response.status_code }")
|
64
|
+
|
65
|
+
return response
|
66
|
+
|
67
|
+
def put(self, endpoint, data, timeout=None):
|
68
|
+
url = f"{self.base_url}{endpoint}"
|
69
|
+
|
70
|
+
self.logger.debug(f"Sending PUT request for tenant {self.tenant} at url: {url}")
|
71
|
+
response = requests.put(url, data=data, timeout=timeout)
|
72
|
+
self.logger.debug(f"Received PUT response with status: {response.status_code}")
|
73
|
+
return response
|
74
|
+
|
75
|
+
def verify_upload(self, params=None):
|
76
|
+
endpoint = "/dbt/v1/verify_upload"
|
77
|
+
self.post(endpoint, data=params)
|
78
|
+
|
79
|
+
def get_signed_url(self, params=None):
|
80
|
+
endpoint = "/dbt/v1/signed_url"
|
81
|
+
return self.get(endpoint, params=params)
|
82
|
+
|
83
|
+
def validate_credentials(self):
|
84
|
+
endpoint = "/dbt/v3/validate-credentials"
|
85
|
+
return self.get(endpoint)
|
@@ -0,0 +1,75 @@
|
|
1
|
+
import os
|
2
|
+
from pathlib import Path
|
3
|
+
from typing import Dict
|
4
|
+
from typing import Optional
|
5
|
+
|
6
|
+
import click
|
7
|
+
from requests import Response
|
8
|
+
|
9
|
+
from datapilot.clients.altimate.client import APIClient
|
10
|
+
|
11
|
+
|
12
|
+
def check_token_and_instance(
|
13
|
+
token: Optional[str],
|
14
|
+
instance_name: Optional[str],
|
15
|
+
):
|
16
|
+
if not token:
|
17
|
+
token = os.environ.get("ALTIMATE_API_KEY")
|
18
|
+
|
19
|
+
if not instance_name:
|
20
|
+
instance_name = os.environ.get("ALTIMATE_INSTANCE_NAME")
|
21
|
+
|
22
|
+
if not token or not instance_name:
|
23
|
+
click.echo(
|
24
|
+
"Error: API TOKEN and instance name is required. Please provide a valid API token."
|
25
|
+
" You can pass it as command line arguments or set it using environment variables like "
|
26
|
+
"ALTIMATE_API_KEY and ALTIMATE_INSTANCE_NAME."
|
27
|
+
)
|
28
|
+
return
|
29
|
+
|
30
|
+
|
31
|
+
def upload_content_to_signed_url(file_path, signed_url) -> Response:
|
32
|
+
api_client = APIClient()
|
33
|
+
|
34
|
+
with Path(file_path).open("rb") as file:
|
35
|
+
file_content = file.read()
|
36
|
+
|
37
|
+
return api_client.put(signed_url, data=file_content)
|
38
|
+
|
39
|
+
|
40
|
+
def validate_credentials(
|
41
|
+
token,
|
42
|
+
backend_url,
|
43
|
+
tenant,
|
44
|
+
) -> Response:
|
45
|
+
api_client = APIClient(api_token=token, base_url=backend_url, tenant=tenant)
|
46
|
+
return api_client.validate_credentials()
|
47
|
+
|
48
|
+
|
49
|
+
def onboard_manifest(api_token, tenant, dbt_core_integration_id, manifest_path, backend_url) -> Dict:
|
50
|
+
api_client = APIClient(api_token, base_url=backend_url, tenant=tenant)
|
51
|
+
|
52
|
+
params = {"dbt_core_integration_id": dbt_core_integration_id, "file_type": "manifest"}
|
53
|
+
signed_url_data = api_client.get_signed_url(params)
|
54
|
+
if signed_url_data:
|
55
|
+
signed_url = signed_url_data.get("url")
|
56
|
+
file_id = signed_url_data.get("dbt_core_integration_file_id")
|
57
|
+
api_client.log(f"Received signed URL: {signed_url}")
|
58
|
+
api_client.log(f"Received File ID: {file_id}")
|
59
|
+
|
60
|
+
upload_response = upload_content_to_signed_url(manifest_path, signed_url)
|
61
|
+
|
62
|
+
if upload_response:
|
63
|
+
verify_params = {"dbt_core_integration_file_id": file_id}
|
64
|
+
api_client.verify_upload(verify_params)
|
65
|
+
return {"ok": True}
|
66
|
+
else:
|
67
|
+
api_client.log(f"Error uploading file: {upload_response.status_code}, {upload_response.text}")
|
68
|
+
return {"ok": False, "message": f"Error uploading file: {upload_response.status_code}, {upload_response.text}"}
|
69
|
+
|
70
|
+
else:
|
71
|
+
api_client.log("Error getting signed URL.")
|
72
|
+
return {
|
73
|
+
"ok": False,
|
74
|
+
"message": "Error in uploading the manifest. ",
|
75
|
+
}
|
File without changes
|
@@ -0,0 +1,16 @@
|
|
1
|
+
from pathlib import Path
|
2
|
+
from typing import Dict
|
3
|
+
|
4
|
+
from ruamel.yaml import YAML
|
5
|
+
|
6
|
+
|
7
|
+
def load_config(config_file_path: str) -> Dict:
|
8
|
+
yaml = YAML(typ="safe")
|
9
|
+
with Path(config_file_path).open() as file:
|
10
|
+
config_dict = yaml.load(file)
|
11
|
+
return config_dict
|
12
|
+
|
13
|
+
|
14
|
+
if __name__ == "__main__":
|
15
|
+
config = load_config("/Users/surya/repos/altimate_dbt_package/tests/data/config.yml")
|
16
|
+
print(config)
|
@@ -0,0 +1,32 @@
|
|
1
|
+
from typing import Dict
|
2
|
+
from typing import Optional
|
3
|
+
|
4
|
+
from datapilot.core.platforms.dbt.constants import FOLDER
|
5
|
+
from datapilot.core.platforms.dbt.constants import MODEL
|
6
|
+
from datapilot.schemas.constants import CONFIG_INSIGHTS
|
7
|
+
from datapilot.schemas.constants import CONFIG_MODEL_TYPE_PATTERNS
|
8
|
+
|
9
|
+
|
10
|
+
def get_regex_configuration(
|
11
|
+
config: Optional[Dict],
|
12
|
+
) -> Dict[str, Optional[Dict[str, str]]]:
|
13
|
+
model_type_patterns = config.get(CONFIG_MODEL_TYPE_PATTERNS, None)
|
14
|
+
folder_type_patterns = config.get(CONFIG_MODEL_TYPE_PATTERNS, None)
|
15
|
+
return {
|
16
|
+
MODEL: model_type_patterns,
|
17
|
+
FOLDER: folder_type_patterns,
|
18
|
+
}
|
19
|
+
# Return the configured fanout threshold or the default if not specified
|
20
|
+
|
21
|
+
|
22
|
+
def get_insight_configuration(config: Optional[Dict]) -> Dict[str, Optional[Dict[str, str]]]:
|
23
|
+
insight_config = config.get(CONFIG_INSIGHTS, None)
|
24
|
+
return insight_config
|
25
|
+
|
26
|
+
|
27
|
+
def get_insight_config(config: Optional[Dict], insight_alias: str, config_key: str):
|
28
|
+
if config is None:
|
29
|
+
return None
|
30
|
+
insights = config.get(CONFIG_INSIGHTS, {})
|
31
|
+
insight = insights.get(insight_alias, {})
|
32
|
+
return insight.get(config_key, None)
|
File without changes
|
File without changes
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import logging
|
2
|
+
from abc import ABC
|
3
|
+
from abc import abstractmethod
|
4
|
+
from typing import ClassVar
|
5
|
+
from typing import Dict
|
6
|
+
from typing import Optional
|
7
|
+
from typing import Tuple
|
8
|
+
|
9
|
+
from datapilot.core.insights.schema import InsightResponse
|
10
|
+
|
11
|
+
|
12
|
+
class Insight(ABC):
|
13
|
+
NAME = "Insight"
|
14
|
+
TYPE = "BaseInsight"
|
15
|
+
DESCRIPTION = "Base Insight"
|
16
|
+
FILES_REQUIRED: ClassVar = []
|
17
|
+
ALIAS = "base_insight"
|
18
|
+
|
19
|
+
def __init__(self, config: Optional[Dict] = None, *args, **kwargs):
|
20
|
+
self.config = config or {}
|
21
|
+
self.args = args
|
22
|
+
self.kwargs = kwargs
|
23
|
+
self.logger = logging.getLogger(self.__class__.__name__)
|
24
|
+
|
25
|
+
@abstractmethod
|
26
|
+
def generate(self, *args, **kwargs) -> InsightResponse:
|
27
|
+
pass
|
28
|
+
|
29
|
+
@classmethod
|
30
|
+
def has_all_required_data(cls, **kwargs) -> Tuple[bool, str]:
|
31
|
+
"""
|
32
|
+
return False
|
33
|
+
"""
|
34
|
+
return False, "Not implemented"
|
@@ -0,0 +1,16 @@
|
|
1
|
+
def generate_ci_cd_report(insights_data):
|
2
|
+
"""
|
3
|
+
Generates a CI/CD friendly report from DBT model insights.
|
4
|
+
|
5
|
+
:param insights_data: List of DBTInsightResult objects.
|
6
|
+
"""
|
7
|
+
divider = "-" * 80
|
8
|
+
for insight in insights_data:
|
9
|
+
print(divider)
|
10
|
+
print(f"Project: {insight.package_name}")
|
11
|
+
print(f"Model ID: {insight.model_unique_id}")
|
12
|
+
print(f"Name: {insight.metadata['model']}")
|
13
|
+
print(f"Message: {insight.message}")
|
14
|
+
print(f"Reason: {insight.reason_to_flag}")
|
15
|
+
print(f"Recommendation: {insight.recommendation}")
|
16
|
+
print(divider)
|
@@ -0,0 +1,24 @@
|
|
1
|
+
from enum import Enum
|
2
|
+
from typing import Dict
|
3
|
+
|
4
|
+
from pydantic import BaseModel
|
5
|
+
|
6
|
+
|
7
|
+
class Severity(Enum):
|
8
|
+
INFO = "INFO"
|
9
|
+
WARNING = "WARNING"
|
10
|
+
ERROR = "ERROR"
|
11
|
+
|
12
|
+
|
13
|
+
class InsightResult(BaseModel):
|
14
|
+
name: str
|
15
|
+
type: str
|
16
|
+
message: str
|
17
|
+
recommendation: str
|
18
|
+
reason_to_flag: str
|
19
|
+
metadata: Dict
|
20
|
+
|
21
|
+
|
22
|
+
class InsightResponse(BaseModel):
|
23
|
+
insight: InsightResult
|
24
|
+
severity: Severity = Severity.ERROR
|
File without changes
|
File without changes
|
@@ -0,0 +1,18 @@
|
|
1
|
+
from abc import abstractmethod
|
2
|
+
from typing import Optional
|
3
|
+
|
4
|
+
from datapilot.core.insights.base.insight import Insight
|
5
|
+
from datapilot.schemas.sql import Dialect
|
6
|
+
|
7
|
+
|
8
|
+
class SqlInsight(Insight):
|
9
|
+
NAME = "SqlInsight"
|
10
|
+
|
11
|
+
def __init__(self, sql: str, dialect: Optional[Dialect], *args, **kwargs):
|
12
|
+
self.sql = sql
|
13
|
+
self.dialect = dialect
|
14
|
+
super().__init__(*args, **kwargs)
|
15
|
+
|
16
|
+
@abstractmethod
|
17
|
+
def generate(self, *args, **kwargs) -> dict:
|
18
|
+
pass
|
File without changes
|
File without changes
|