datacontract-cli 0.10.9__tar.gz → 0.10.11__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 datacontract-cli might be problematic. Click here for more details.
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/PKG-INFO +262 -154
- datacontract_cli-0.10.9/datacontract_cli.egg-info/PKG-INFO → datacontract_cli-0.10.11/README.md +248 -217
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/cli.py +7 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/data_contract.py +16 -9
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/engines/fastjsonschema/check_jsonschema.py +4 -1
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/engines/soda/check_soda_execute.py +5 -2
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/engines/soda/connections/duckdb.py +20 -12
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/engines/soda/connections/snowflake.py +8 -5
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/export/avro_converter.py +1 -1
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/export/dbml_converter.py +41 -19
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/export/exporter.py +1 -1
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/export/jsonschema_converter.py +1 -4
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/export/sodacl_converter.py +1 -1
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/imports/avro_importer.py +142 -8
- datacontract_cli-0.10.11/datacontract/imports/dbt_importer.py +117 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/imports/glue_importer.py +9 -3
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/imports/importer.py +7 -2
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/imports/importer_factory.py +24 -6
- datacontract_cli-0.10.11/datacontract/imports/jsonschema_importer.py +145 -0
- datacontract_cli-0.10.11/datacontract/imports/spark_importer.py +134 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/imports/sql_importer.py +4 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/integration/publish_datamesh_manager.py +10 -5
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/lint/resolve.py +72 -27
- datacontract_cli-0.10.11/datacontract/lint/schema.py +47 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/model/data_contract_specification.py +3 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/templates/datacontract.html +1 -1
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/templates/index.html +1 -1
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/templates/partials/model_field.html +10 -2
- datacontract_cli-0.10.9/README.md → datacontract_cli-0.10.11/datacontract_cli.egg-info/PKG-INFO +325 -140
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract_cli.egg-info/SOURCES.txt +7 -1
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract_cli.egg-info/requires.txt +13 -13
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/pyproject.toml +14 -14
- datacontract_cli-0.10.9/tests/test_schema.py → datacontract_cli-0.10.11/tests/test_export_complex_data_contract.py +41 -3
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_export_dbml.py +8 -24
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_export_jsonschema.py +4 -10
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_import_avro.py +41 -4
- datacontract_cli-0.10.11/tests/test_import_dbt.py +255 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_import_glue.py +5 -1
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_import_jsonschema.py +3 -3
- datacontract_cli-0.10.11/tests/test_import_spark.py +162 -0
- datacontract_cli-0.10.11/tests/test_import_sql.py +118 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_integration_datameshmanager.py +1 -1
- datacontract_cli-0.10.11/tests/test_resolve.py +114 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_test_dataframe.py +30 -21
- datacontract_cli-0.10.11/tests/test_test_delta.py +29 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_test_sqlserver.py +2 -2
- datacontract_cli-0.10.9/datacontract/imports/jsonschema_importer.py +0 -156
- datacontract_cli-0.10.9/datacontract/lint/schema.py +0 -27
- datacontract_cli-0.10.9/tests/test_import_sql.py +0 -58
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/LICENSE +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/MANIFEST.in +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/__init__.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/breaking/breaking.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/breaking/breaking_rules.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/catalog/catalog.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/engines/__init__.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/engines/datacontract/check_that_datacontract_contains_valid_servers_configuration.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/engines/datacontract/check_that_datacontract_file_exists.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/engines/datacontract/check_that_datacontract_str_is_valid.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/engines/fastjsonschema/s3/s3_read_files.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/engines/soda/__init__.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/engines/soda/connections/bigquery.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/engines/soda/connections/dask.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/engines/soda/connections/databricks.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/engines/soda/connections/kafka.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/engines/soda/connections/postgres.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/engines/soda/connections/sqlserver.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/engines/soda/connections/trino.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/export/__init__.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/export/avro_idl_converter.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/export/bigquery_converter.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/export/csv_type_converter.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/export/dbt_converter.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/export/exporter_factory.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/export/go_converter.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/export/great_expectations_converter.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/export/html_export.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/export/odcs_converter.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/export/protobuf_converter.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/export/pydantic_converter.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/export/rdf_converter.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/export/spark_converter.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/export/sql_converter.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/export/sql_type_converter.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/export/terraform_converter.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/imports/bigquery_importer.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/imports/odcs_importer.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/imports/unity_importer.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/init/download_datacontract_file.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/integration/publish_opentelemetry.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/lint/files.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/lint/lint.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/lint/linters/__init__.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/lint/linters/description_linter.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/lint/linters/example_model_linter.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/lint/linters/field_pattern_linter.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/lint/linters/field_reference_linter.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/lint/linters/notice_period_linter.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/lint/linters/quality_schema_linter.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/lint/linters/valid_constraints_linter.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/lint/urls.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/model/breaking_change.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/model/exceptions.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/model/run.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/publish/publish.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/py.typed +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/templates/partials/datacontract_information.html +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/templates/partials/datacontract_servicelevels.html +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/templates/partials/datacontract_terms.html +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/templates/partials/definition.html +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/templates/partials/example.html +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/templates/partials/server.html +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/templates/style/output.css +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract/web.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract_cli.egg-info/dependency_links.txt +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract_cli.egg-info/entry_points.txt +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/datacontract_cli.egg-info/top_level.txt +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/setup.cfg +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_breaking.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_catalog.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_changelog.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_cli.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_description_linter.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_documentation_linter.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_download_datacontract_file.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_example_model_linter.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_export_avro.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_export_avro_idl.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_export_bigquery.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_export_custom_exporter.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_export_dbt_models.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_export_dbt_sources.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_export_dbt_staging_sql.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_export_go.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_export_great_expectations.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_export_html.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_export_odcs.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_export_protobuf.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_export_pydantic.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_export_rdf.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_export_sodacl.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_export_spark.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_export_sql.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_export_sql_query.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_export_terraform.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_field_constraint_linter.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_field_pattern_linter.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_field_reference_linter.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_import_bigquery.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_import_odcs.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_import_unity_file.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_integration_opentelemetry.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_lint.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_notice_period_linter.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_quality_schema_linter.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_roundtrip_jsonschema.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_test_azure_parquet_remote.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_test_bigquery.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_test_databricks.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_test_examples_csv.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_test_examples_formats_valid.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_test_examples_inline.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_test_examples_json.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_test_examples_missing.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_test_kafka.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_test_kafka_remote.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_test_local_json.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_test_parquet.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_test_postgres.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_test_s3_csv.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_test_s3_delta.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_test_s3_json.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_test_s3_json_complex.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_test_s3_json_multiple_models.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_test_s3_json_remote.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_test_snowflake.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_test_trino.py +0 -0
- {datacontract_cli-0.10.9 → datacontract_cli-0.10.11}/tests/test_web.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: datacontract-cli
|
|
3
|
-
Version: 0.10.
|
|
3
|
+
Version: 0.10.11
|
|
4
4
|
Summary: The datacontract CLI is an open source command-line tool for working with Data Contracts. It uses data contract YAML files to lint the data contract, connect to data sources and execute schema and quality tests, detect breaking changes, and export to different formats. The tool is written in Python. It can be used as a standalone CLI tool, in a CI/CD pipeline, or directly as a Python library.
|
|
5
5
|
Author-email: Jochen Christ <jochen.christ@innoq.com>, Stefan Negele <stefan.negele@innoq.com>, Simon Harrer <simon.harrer@innoq.com>
|
|
6
6
|
Project-URL: Homepage, https://cli.datacontract.com
|
|
@@ -12,14 +12,14 @@ Requires-Python: >=3.10
|
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE
|
|
14
14
|
Requires-Dist: typer[all]<0.13,>=0.9
|
|
15
|
-
Requires-Dist: pydantic<2.
|
|
15
|
+
Requires-Dist: pydantic<2.9.0,>=2.8.2
|
|
16
16
|
Requires-Dist: pyyaml~=6.0.1
|
|
17
17
|
Requires-Dist: requests<2.33,>=2.31
|
|
18
|
-
Requires-Dist: fastapi==0.111.
|
|
18
|
+
Requires-Dist: fastapi==0.111.1
|
|
19
19
|
Requires-Dist: fastparquet==2024.5.0
|
|
20
20
|
Requires-Dist: python-multipart==0.0.9
|
|
21
21
|
Requires-Dist: rich~=13.7.0
|
|
22
|
-
Requires-Dist: simple-ddl-parser==1.5.
|
|
22
|
+
Requires-Dist: simple-ddl-parser==1.5.2
|
|
23
23
|
Requires-Dist: soda-core-duckdb<3.4.0,>=3.3.1
|
|
24
24
|
Requires-Dist: setuptools>=60
|
|
25
25
|
Requires-Dist: duckdb==1.0.0
|
|
@@ -37,7 +37,7 @@ Provides-Extra: bigquery
|
|
|
37
37
|
Requires-Dist: soda-core-bigquery<3.4.0,>=3.3.1; extra == "bigquery"
|
|
38
38
|
Provides-Extra: databricks
|
|
39
39
|
Requires-Dist: soda-core-spark-df<3.4.0,>=3.3.1; extra == "databricks"
|
|
40
|
-
Requires-Dist: databricks-sql-connector<3.
|
|
40
|
+
Requires-Dist: databricks-sql-connector<3.4.0,>=3.1.2; extra == "databricks"
|
|
41
41
|
Requires-Dist: soda-core-spark[databricks]<3.4.0,>=3.3.1; extra == "databricks"
|
|
42
42
|
Provides-Extra: deltalake
|
|
43
43
|
Requires-Dist: deltalake<0.19,>=0.17; extra == "deltalake"
|
|
@@ -61,19 +61,19 @@ Provides-Extra: dev
|
|
|
61
61
|
Requires-Dist: datacontract-cli[all]; extra == "dev"
|
|
62
62
|
Requires-Dist: httpx==0.27.0; extra == "dev"
|
|
63
63
|
Requires-Dist: ruff; extra == "dev"
|
|
64
|
-
Requires-Dist: pre-commit
|
|
64
|
+
Requires-Dist: pre-commit<3.9.0,>=3.7.1; extra == "dev"
|
|
65
65
|
Requires-Dist: pytest; extra == "dev"
|
|
66
66
|
Requires-Dist: pytest-xdist; extra == "dev"
|
|
67
|
-
Requires-Dist: moto; extra == "dev"
|
|
67
|
+
Requires-Dist: moto==5.0.11; extra == "dev"
|
|
68
68
|
Requires-Dist: pymssql==2.3.0; extra == "dev"
|
|
69
69
|
Requires-Dist: kafka-python; extra == "dev"
|
|
70
|
-
Requires-Dist: trino==0.
|
|
71
|
-
Requires-Dist: testcontainers
|
|
72
|
-
Requires-Dist: testcontainers[core]; extra == "dev"
|
|
73
|
-
Requires-Dist: testcontainers[minio]; extra == "dev"
|
|
74
|
-
Requires-Dist: testcontainers[postgres]; extra == "dev"
|
|
75
|
-
Requires-Dist: testcontainers[kafka]; extra == "dev"
|
|
76
|
-
Requires-Dist: testcontainers[mssql]; extra == "dev"
|
|
70
|
+
Requires-Dist: trino==0.329.0; extra == "dev"
|
|
71
|
+
Requires-Dist: testcontainers==4.7.2; extra == "dev"
|
|
72
|
+
Requires-Dist: testcontainers[core]==4.7.2; extra == "dev"
|
|
73
|
+
Requires-Dist: testcontainers[minio]==4.7.2; extra == "dev"
|
|
74
|
+
Requires-Dist: testcontainers[postgres]==4.7.2; extra == "dev"
|
|
75
|
+
Requires-Dist: testcontainers[kafka]==4.7.2; extra == "dev"
|
|
76
|
+
Requires-Dist: testcontainers[mssql]==4.7.2; extra == "dev"
|
|
77
77
|
|
|
78
78
|
# Data Contract CLI
|
|
79
79
|
|
|
@@ -197,10 +197,10 @@ $ datacontract export --format html datacontract.yaml > datacontract.html
|
|
|
197
197
|
# import avro (other formats: sql, glue, bigquery...)
|
|
198
198
|
$ datacontract import --format avro --source avro_schema.avsc
|
|
199
199
|
|
|
200
|
-
# find differences between
|
|
200
|
+
# find differences between two data contracts
|
|
201
201
|
$ datacontract diff datacontract-v1.yaml datacontract-v2.yaml
|
|
202
202
|
|
|
203
|
-
# find differences between
|
|
203
|
+
# find differences between two data contracts categorized into error, warning, and info.
|
|
204
204
|
$ datacontract changelog datacontract-v1.yaml datacontract-v2.yaml
|
|
205
205
|
|
|
206
206
|
# fail pipeline on breaking changes. Uses changelog internally and showing only error and warning.
|
|
@@ -300,16 +300,16 @@ Commands
|
|
|
300
300
|
Download a datacontract.yaml template and write it to file.
|
|
301
301
|
|
|
302
302
|
╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────╮
|
|
303
|
-
│ location [LOCATION] The location (url or path) of the data contract yaml to create.
|
|
304
|
-
│ [default: datacontract.yaml]
|
|
303
|
+
│ location [LOCATION] The location (url or path) of the data contract yaml to create. │
|
|
304
|
+
│ [default: datacontract.yaml] │
|
|
305
305
|
╰──────────────────────────────────────────────────────────────────────────────────────────────╯
|
|
306
306
|
╭─ Options ────────────────────────────────────────────────────────────────────────────────────╮
|
|
307
|
-
│ --template TEXT URL of a template or data contract
|
|
308
|
-
│ [default:
|
|
309
|
-
│ https://datacontract.com/datacontract.init.yaml]
|
|
310
|
-
│ --overwrite --no-overwrite Replace the existing datacontract.yaml
|
|
311
|
-
│ [default: no-overwrite]
|
|
312
|
-
│ --help Show this message and exit.
|
|
307
|
+
│ --template TEXT URL of a template or data contract │
|
|
308
|
+
│ [default: │
|
|
309
|
+
│ https://datacontract.com/datacontract.init.yaml] │
|
|
310
|
+
│ --overwrite --no-overwrite Replace the existing datacontract.yaml │
|
|
311
|
+
│ [default: no-overwrite] │
|
|
312
|
+
│ --help Show this message and exit. │
|
|
313
313
|
╰──────────────────────────────────────────────────────────────────────────────────────────────╯
|
|
314
314
|
```
|
|
315
315
|
|
|
@@ -321,12 +321,12 @@ Commands
|
|
|
321
321
|
Validate that the datacontract.yaml is correctly formatted.
|
|
322
322
|
|
|
323
323
|
╭─ Arguments ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
|
324
|
-
│ location [LOCATION] The location (url or path) of the data contract yaml. [default: datacontract.yaml]
|
|
324
|
+
│ location [LOCATION] The location (url or path) of the data contract yaml. [default: datacontract.yaml] │
|
|
325
325
|
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
|
326
326
|
╭─ Options ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
|
327
|
-
│ --schema TEXT The location (url or path) of the Data Contract Specification JSON Schema
|
|
328
|
-
│ [default: https://datacontract.com/datacontract.schema.json]
|
|
329
|
-
│ --help Show this message and exit.
|
|
327
|
+
│ --schema TEXT The location (url or path) of the Data Contract Specification JSON Schema │
|
|
328
|
+
│ [default: https://datacontract.com/datacontract.schema.json] │
|
|
329
|
+
│ --help Show this message and exit. │
|
|
330
330
|
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
|
331
331
|
```
|
|
332
332
|
|
|
@@ -338,28 +338,28 @@ Commands
|
|
|
338
338
|
Run schema and quality tests on configured servers.
|
|
339
339
|
|
|
340
340
|
╭─ Arguments ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
|
341
|
-
│ location [LOCATION] The location (url or path) of the data contract yaml. [default: datacontract.yaml]
|
|
341
|
+
│ location [LOCATION] The location (url or path) of the data contract yaml. [default: datacontract.yaml] │
|
|
342
342
|
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
|
343
343
|
╭─ Options ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
|
344
|
-
│ --schema TEXT The location (url or path) of the Data Contract
|
|
345
|
-
│ Specification JSON Schema
|
|
346
|
-
│ [default:
|
|
347
|
-
│ https://datacontract.com/datacontract.schema.json]
|
|
348
|
-
│ --server TEXT The server configuration to run the schema and quality
|
|
349
|
-
│ tests. Use the key of the server object in the data
|
|
350
|
-
│ contract yaml file to refer to a server, e.g.,
|
|
351
|
-
│ `production`, or `all` for all servers (default).
|
|
352
|
-
│ [default: all]
|
|
353
|
-
│ --examples --no-examples Run the schema and quality tests on the example data
|
|
354
|
-
│ within the data contract.
|
|
355
|
-
│ [default: no-examples]
|
|
356
|
-
│ --publish TEXT The url to publish the results after the test
|
|
357
|
-
│ [default: None]
|
|
358
|
-
│ --publish-to-opentelemetry --no-publish-to-opentelemetry Publish the results to opentelemetry. Use environment
|
|
359
|
-
│ variables to configure the OTLP endpoint, headers, etc.
|
|
360
|
-
│ [default: no-publish-to-opentelemetry]
|
|
361
|
-
│ --logs --no-logs Print logs [default: no-logs]
|
|
362
|
-
│ --help Show this message and exit.
|
|
344
|
+
│ --schema TEXT The location (url or path) of the Data Contract │
|
|
345
|
+
│ Specification JSON Schema │
|
|
346
|
+
│ [default: │
|
|
347
|
+
│ https://datacontract.com/datacontract.schema.json] │
|
|
348
|
+
│ --server TEXT The server configuration to run the schema and quality │
|
|
349
|
+
│ tests. Use the key of the server object in the data │
|
|
350
|
+
│ contract yaml file to refer to a server, e.g., │
|
|
351
|
+
│ `production`, or `all` for all servers (default). │
|
|
352
|
+
│ [default: all] │
|
|
353
|
+
│ --examples --no-examples Run the schema and quality tests on the example data │
|
|
354
|
+
│ within the data contract. │
|
|
355
|
+
│ [default: no-examples] │
|
|
356
|
+
│ --publish TEXT The url to publish the results after the test │
|
|
357
|
+
│ [default: None] │
|
|
358
|
+
│ --publish-to-opentelemetry --no-publish-to-opentelemetry Publish the results to opentelemetry. Use environment │
|
|
359
|
+
│ variables to configure the OTLP endpoint, headers, etc. │
|
|
360
|
+
│ [default: no-publish-to-opentelemetry] │
|
|
361
|
+
│ --logs --no-logs Print logs [default: no-logs] │
|
|
362
|
+
│ --help Show this message and exit. │
|
|
363
363
|
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
|
364
364
|
```
|
|
365
365
|
|
|
@@ -385,7 +385,7 @@ Supported server types:
|
|
|
385
385
|
- [sqlserver](#sqlserver)
|
|
386
386
|
- [databricks](#databricks)
|
|
387
387
|
- [databricks (programmatic)](#databricks-programmatic)
|
|
388
|
-
- [
|
|
388
|
+
- [dataframe (programmatic)](#dataframe-programmatic)
|
|
389
389
|
- [snowflake](#snowflake)
|
|
390
390
|
- [kafka](#kafka)
|
|
391
391
|
- [postgres](#postgres)
|
|
@@ -473,7 +473,6 @@ models:
|
|
|
473
473
|
| `DATACONTRACT_BIGQUERY_ACCOUNT_INFO_JSON_PATH` | `~/service-access-key.json` | Service Access key as saved on key creation by BigQuery. If this environment variable isn't set, the cli tries to use `GOOGLE_APPLICATION_CREDENTIALS` as a fallback, so if you have that set for using their Python library anyway, it should work seamlessly. |
|
|
474
474
|
|
|
475
475
|
|
|
476
|
-
|
|
477
476
|
### Azure
|
|
478
477
|
|
|
479
478
|
Data Contract CLI can test data that is stored in Azure Blob storage or Azure Data Lake Storage (Gen2) (ADLS) in various formats.
|
|
@@ -493,11 +492,11 @@ servers:
|
|
|
493
492
|
|
|
494
493
|
Authentication works with an Azure Service Principal (SPN) aka App Registration with a secret.
|
|
495
494
|
|
|
496
|
-
| Environment Variable
|
|
497
|
-
|
|
498
|
-
| `DATACONTRACT_AZURE_TENANT_ID`
|
|
499
|
-
| `DATACONTRACT_AZURE_CLIENT_ID` | `3cf7ce49-e2e9-4cbc-a922-4328d4a58622`
|
|
500
|
-
| `DATACONTRACT_AZURE_CLIENT_SECRET` | `yZK8Q~GWO1MMXXXXXXXXXXXXX`
|
|
495
|
+
| Environment Variable | Example | Description |
|
|
496
|
+
|------------------------------------|----------------------------------------|------------------------------------------------------|
|
|
497
|
+
| `DATACONTRACT_AZURE_TENANT_ID` | `79f5b80f-10ff-40b9-9d1f-774b42d605fc` | The Azure Tenant ID |
|
|
498
|
+
| `DATACONTRACT_AZURE_CLIENT_ID` | `3cf7ce49-e2e9-4cbc-a922-4328d4a58622` | The ApplicationID / ClientID of the app registration |
|
|
499
|
+
| `DATACONTRACT_AZURE_CLIENT_SECRET` | `yZK8Q~GWO1MMXXXXXXXXXXXXX` | The Client Secret value |
|
|
501
500
|
|
|
502
501
|
|
|
503
502
|
|
|
@@ -527,13 +526,13 @@ models:
|
|
|
527
526
|
|
|
528
527
|
#### Environment Variables
|
|
529
528
|
|
|
530
|
-
| Environment Variable
|
|
531
|
-
|
|
532
|
-
| `DATACONTRACT_SQLSERVER_USERNAME`
|
|
533
|
-
| `DATACONTRACT_SQLSERVER_PASSWORD`
|
|
534
|
-
| `DATACONTRACT_SQLSERVER_TRUSTED_CONNECTION`
|
|
535
|
-
| `DATACONTRACT_SQLSERVER_TRUST_SERVER_CERTIFICATE` | `True` | Trust self-signed certificate
|
|
536
|
-
| `DATACONTRACT_SQLSERVER_ENCRYPTED_CONNECTION`
|
|
529
|
+
| Environment Variable | Example| Description |
|
|
530
|
+
|---------------------------------------------------|--------|----------------------------------------------|
|
|
531
|
+
| `DATACONTRACT_SQLSERVER_USERNAME` | `root` | Username |
|
|
532
|
+
| `DATACONTRACT_SQLSERVER_PASSWORD` | `toor` | Password |
|
|
533
|
+
| `DATACONTRACT_SQLSERVER_TRUSTED_CONNECTION` | `True` | Use windows authentication, instead of login |
|
|
534
|
+
| `DATACONTRACT_SQLSERVER_TRUST_SERVER_CERTIFICATE` | `True` | Trust self-signed certificate |
|
|
535
|
+
| `DATACONTRACT_SQLSERVER_ENCRYPTED_CONNECTION` | `True` | Use SSL |
|
|
537
536
|
|
|
538
537
|
|
|
539
538
|
|
|
@@ -564,8 +563,8 @@ models:
|
|
|
564
563
|
|
|
565
564
|
| Environment Variable | Example | Description |
|
|
566
565
|
|----------------------------------------------|--------------------------------------|-------------------------------------------------------|
|
|
567
|
-
| `DATACONTRACT_DATABRICKS_TOKEN`
|
|
568
|
-
| `DATACONTRACT_DATABRICKS_HTTP_PATH`
|
|
566
|
+
| `DATACONTRACT_DATABRICKS_TOKEN` | `dapia00000000000000000000000000000` | The personal access token to authenticate |
|
|
567
|
+
| `DATACONTRACT_DATABRICKS_HTTP_PATH` | `/sql/1.0/warehouses/b053a3ffffffff` | The HTTP path to the SQL warehouse or compute cluster |
|
|
569
568
|
|
|
570
569
|
|
|
571
570
|
### Databricks (programmatic)
|
|
@@ -610,7 +609,7 @@ run.result
|
|
|
610
609
|
|
|
611
610
|
Works with Spark DataFrames.
|
|
612
611
|
DataFrames need to be created as named temporary views.
|
|
613
|
-
Multiple temporary views are
|
|
612
|
+
Multiple temporary views are supported if your data contract contains multiple models.
|
|
614
613
|
|
|
615
614
|
Testing DataFrames is useful to test your datasets in a pipeline before writing them to a data source.
|
|
616
615
|
|
|
@@ -666,14 +665,31 @@ models:
|
|
|
666
665
|
```
|
|
667
666
|
|
|
668
667
|
#### Environment Variables
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
|
673
|
-
|
|
674
|
-
| `
|
|
675
|
-
| `
|
|
676
|
-
|
|
668
|
+
All [parameters supported by Soda](https://docs.soda.io/soda/connect-snowflake.html), uppercased and prepended by `DATACONTRACT_SNOWFLAKE_` prefix.
|
|
669
|
+
For example:
|
|
670
|
+
|
|
671
|
+
| Soda parameter | Environment Variable |
|
|
672
|
+
|----------------------|---------------------------------------------|
|
|
673
|
+
| `username` | `DATACONTRACT_SNOWFLAKE_USERNAME` |
|
|
674
|
+
| `password` | `DATACONTRACT_SNOWFLAKE_PASSWORD` |
|
|
675
|
+
| `warehouse` | `DATACONTRACT_SNOWFLAKE_WAREHOUSE` |
|
|
676
|
+
| `role` | `DATACONTRACT_SNOWFLAKE_ROLE` |
|
|
677
|
+
| `connection_timeout` | `DATACONTRACT_SNOWFLAKE_CONNECTION_TIMEOUT` |
|
|
678
|
+
|
|
679
|
+
Beware, that parameters:
|
|
680
|
+
* `account`
|
|
681
|
+
* `database`
|
|
682
|
+
* `schema`
|
|
683
|
+
|
|
684
|
+
are obtained from the `servers` section of the YAML-file.
|
|
685
|
+
E.g. from the example above:
|
|
686
|
+
```yaml
|
|
687
|
+
servers:
|
|
688
|
+
snowflake:
|
|
689
|
+
account: abcdefg-xn12345
|
|
690
|
+
database: ORDER_DB
|
|
691
|
+
schema: ORDERS_PII_V2
|
|
692
|
+
```
|
|
677
693
|
|
|
678
694
|
|
|
679
695
|
### Kafka
|
|
@@ -778,7 +794,7 @@ models:
|
|
|
778
794
|
│ * --format [jsonschema|pydantic-model|sodacl|dbt|dbt-sources|db The export format. [default: None] [required] │
|
|
779
795
|
│ t-staging-sql|odcs|rdf|avro|protobuf|great-expectati │
|
|
780
796
|
│ ons|terraform|avro-idl|sql|sql-query|html|go|bigquer │
|
|
781
|
-
│ y|dbml|spark]
|
|
797
|
+
│ y|dbml|spark] │
|
|
782
798
|
│ --output PATH Specify the file path where the exported data will be │
|
|
783
799
|
│ saved. If no path is provided, the output will be │
|
|
784
800
|
│ printed to stdout. │
|
|
@@ -926,22 +942,34 @@ models:
|
|
|
926
942
|
```
|
|
927
943
|
Usage: datacontract import [OPTIONS]
|
|
928
944
|
|
|
929
|
-
Create a data contract from the given source location. Prints to stdout.
|
|
930
|
-
|
|
931
|
-
╭─ Options
|
|
932
|
-
│ * --format
|
|
933
|
-
│
|
|
934
|
-
│
|
|
935
|
-
│ --
|
|
936
|
-
│
|
|
937
|
-
│
|
|
938
|
-
│ --
|
|
939
|
-
│
|
|
940
|
-
│
|
|
941
|
-
│
|
|
942
|
-
│
|
|
943
|
-
│ --
|
|
944
|
-
|
|
945
|
+
Create a data contract from the given source location. Prints to stdout.
|
|
946
|
+
|
|
947
|
+
╭─ Options ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
|
948
|
+
│ * --format [sql|avro|dbt|glue|jsonschema|bigquery|odcs The format of the source file. │
|
|
949
|
+
│ |unity|spark] [default: None] │
|
|
950
|
+
│ [required] │
|
|
951
|
+
│ --source TEXT The path to the file or Glue Database that │
|
|
952
|
+
│ should be imported. │
|
|
953
|
+
│ [default: None] │
|
|
954
|
+
│ --glue-table TEXT List of table ids to import from the Glue │
|
|
955
|
+
│ Database (repeat for multiple table ids, │
|
|
956
|
+
│ leave empty for all tables in the dataset). │
|
|
957
|
+
│ [default: None] │
|
|
958
|
+
│ --bigquery-project TEXT The bigquery project id. [default: None] │
|
|
959
|
+
│ --bigquery-dataset TEXT The bigquery dataset id. [default: None] │
|
|
960
|
+
│ --bigquery-table TEXT List of table ids to import from the │
|
|
961
|
+
│ bigquery API (repeat for multiple table ids, │
|
|
962
|
+
│ leave empty for all tables in the dataset). │
|
|
963
|
+
│ [default: None] │
|
|
964
|
+
│ --unity-table-full-name TEXT Full name of a table in the unity catalog │
|
|
965
|
+
│ [default: None] │
|
|
966
|
+
│ --dbt-model TEXT List of models names to import from the dbt │
|
|
967
|
+
│ manifest file (repeat for multiple models │
|
|
968
|
+
│ names, leave empty for all models in the │
|
|
969
|
+
│ dataset). │
|
|
970
|
+
│ [default: None] │
|
|
971
|
+
│ --help Show this message and exit. │
|
|
972
|
+
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
|
945
973
|
```
|
|
946
974
|
|
|
947
975
|
Example:
|
|
@@ -952,18 +980,19 @@ datacontract import --format sql --source my_ddl.sql
|
|
|
952
980
|
|
|
953
981
|
Available import options:
|
|
954
982
|
|
|
955
|
-
| Type | Description | Status
|
|
956
|
-
|
|
983
|
+
| Type | Description | Status |
|
|
984
|
+
|--------------------|------------------------------------------------|--------|
|
|
957
985
|
| `sql` | Import from SQL DDL | ✅ |
|
|
958
986
|
| `avro` | Import from AVRO schemas | ✅ |
|
|
959
987
|
| `glue` | Import from AWS Glue DataCatalog | ✅ |
|
|
960
|
-
| `
|
|
961
|
-
| `
|
|
962
|
-
| `bigquery` | Import from BigQuery Schemas | ✅ |
|
|
988
|
+
| `jsonschema` | Import from JSON Schemas | ✅ |
|
|
989
|
+
| `bigquery` | Import from BigQuery Schemas | ✅ |
|
|
963
990
|
| `unity` | Import from Databricks Unity Catalog | partial |
|
|
964
|
-
| `dbt` | Import from dbt models |
|
|
965
|
-
| `odcs` | Import from Open Data Contract Standard (ODCS) | ✅
|
|
966
|
-
|
|
|
991
|
+
| `dbt` | Import from dbt models | ✅ |
|
|
992
|
+
| `odcs` | Import from Open Data Contract Standard (ODCS) | ✅ |
|
|
993
|
+
| `spark` | Import from Spark StructTypes | ✅ |
|
|
994
|
+
| `protobuf` | Import from Protobuf schemas | TBD |
|
|
995
|
+
| Missing something? | Please create an issue on GitHub | TBD |
|
|
967
996
|
|
|
968
997
|
|
|
969
998
|
#### BigQuery
|
|
@@ -1005,7 +1034,24 @@ export DATABRICKS_IMPORT_ACCESS_TOKEN=<token>
|
|
|
1005
1034
|
datacontract import --format unity --unity-table-full-name <table_full_name>
|
|
1006
1035
|
```
|
|
1007
1036
|
|
|
1008
|
-
|
|
1037
|
+
#### dbt
|
|
1038
|
+
|
|
1039
|
+
Importing from dbt manifest file.
|
|
1040
|
+
You may give the `dbt-model` parameter to enumerate the tables that should be imported. If no tables are given, _all_ available tables of the database will be imported.
|
|
1041
|
+
|
|
1042
|
+
Examples:
|
|
1043
|
+
|
|
1044
|
+
```bash
|
|
1045
|
+
# Example import from dbt manifest with specifying the tables to import
|
|
1046
|
+
datacontract import --format dbt --source <manifest_path> --dbt-model <model_name_1> --dbt-model <model_name_2> --dbt-model <model_name_3>
|
|
1047
|
+
```
|
|
1048
|
+
|
|
1049
|
+
```bash
|
|
1050
|
+
# Example import from dbt manifest importing all tables in the database
|
|
1051
|
+
datacontract import --format dbt --source <manifest_path>
|
|
1052
|
+
```
|
|
1053
|
+
|
|
1054
|
+
#### Glue
|
|
1009
1055
|
|
|
1010
1056
|
Importing from Glue reads the necessary Data directly off of the AWS API.
|
|
1011
1057
|
You may give the `glue-table` parameter to enumerate the tables that should be imported. If no tables are given, _all_ available tables of the database will be imported.
|
|
@@ -1022,6 +1068,15 @@ datacontract import --format glue --source <database_name> --glue-table <table_n
|
|
|
1022
1068
|
datacontract import --format glue --source <database_name>
|
|
1023
1069
|
```
|
|
1024
1070
|
|
|
1071
|
+
#### Spark
|
|
1072
|
+
|
|
1073
|
+
Importing from Spark table or view these must be created or accessible in the Spark context. Specify tables list in `source` parameter.
|
|
1074
|
+
|
|
1075
|
+
Example:
|
|
1076
|
+
|
|
1077
|
+
```bash
|
|
1078
|
+
datacontract import --format spark --source "users,orders"
|
|
1079
|
+
```
|
|
1025
1080
|
|
|
1026
1081
|
### breaking
|
|
1027
1082
|
|
|
@@ -1031,11 +1086,11 @@ datacontract import --format glue --source <database_name>
|
|
|
1031
1086
|
Identifies breaking changes between data contracts. Prints to stdout.
|
|
1032
1087
|
|
|
1033
1088
|
╭─ Arguments ───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
|
1034
|
-
│ * location_old TEXT The location (url or path) of the old data contract yaml. [default: None] [required]
|
|
1035
|
-
│ * location_new TEXT The location (url or path) of the new data contract yaml. [default: None] [required]
|
|
1089
|
+
│ * location_old TEXT The location (url or path) of the old data contract yaml. [default: None] [required] │
|
|
1090
|
+
│ * location_new TEXT The location (url or path) of the new data contract yaml. [default: None] [required] │
|
|
1036
1091
|
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
|
1037
1092
|
╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
|
1038
|
-
│ --help Show this message and exit.
|
|
1093
|
+
│ --help Show this message and exit. │
|
|
1039
1094
|
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
|
1040
1095
|
```
|
|
1041
1096
|
|
|
@@ -1047,11 +1102,11 @@ datacontract import --format glue --source <database_name>
|
|
|
1047
1102
|
Generate a changelog between data contracts. Prints to stdout.
|
|
1048
1103
|
|
|
1049
1104
|
╭─ Arguments ───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
|
1050
|
-
│ * location_old TEXT The location (url or path) of the old data contract yaml. [default: None] [required]
|
|
1051
|
-
│ * location_new TEXT The location (url or path) of the new data contract yaml. [default: None] [required]
|
|
1105
|
+
│ * location_old TEXT The location (url or path) of the old data contract yaml. [default: None] [required] │
|
|
1106
|
+
│ * location_new TEXT The location (url or path) of the new data contract yaml. [default: None] [required] │
|
|
1052
1107
|
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
|
1053
1108
|
╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
|
1054
|
-
│ --help Show this message and exit.
|
|
1109
|
+
│ --help Show this message and exit. │
|
|
1055
1110
|
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
|
1056
1111
|
```
|
|
1057
1112
|
|
|
@@ -1063,8 +1118,8 @@ datacontract import --format glue --source <database_name>
|
|
|
1063
1118
|
PLACEHOLDER. Currently works as 'changelog' does.
|
|
1064
1119
|
|
|
1065
1120
|
╭─ Arguments ───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
|
1066
|
-
│ * location_old TEXT The location (url or path) of the old data contract yaml. [default: None] [required]
|
|
1067
|
-
│ * location_new TEXT The location (url or path) of the new data contract yaml. [default: None] [required]
|
|
1121
|
+
│ * location_old TEXT The location (url or path) of the old data contract yaml. [default: None] [required] │
|
|
1122
|
+
│ * location_new TEXT The location (url or path) of the new data contract yaml. [default: None] [required] │
|
|
1068
1123
|
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
|
1069
1124
|
╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
|
1070
1125
|
│ --help Show this message and exit. │
|
|
@@ -1080,9 +1135,9 @@ datacontract import --format glue --source <database_name>
|
|
|
1080
1135
|
Create an html catalog of data contracts.
|
|
1081
1136
|
|
|
1082
1137
|
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
|
1083
|
-
│ --files TEXT Glob pattern for the data contract files to include in the catalog. [default: *.yaml]
|
|
1084
|
-
│ --output TEXT Output directory for the catalog html files. [default: catalog/]
|
|
1085
|
-
│ --help Show this message and exit.
|
|
1138
|
+
│ --files TEXT Glob pattern for the data contract files to include in the catalog. [default: *.yaml] │
|
|
1139
|
+
│ --output TEXT Output directory for the catalog html files. [default: catalog/] │
|
|
1140
|
+
│ --help Show this message and exit. │
|
|
1086
1141
|
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
|
1087
1142
|
```
|
|
1088
1143
|
|
|
@@ -1104,19 +1159,22 @@ datacontract import --format glue --source <database_name>
|
|
|
1104
1159
|
|
|
1105
1160
|
## Integrations
|
|
1106
1161
|
|
|
1107
|
-
| Integration
|
|
1108
|
-
|
|
1109
|
-
| Data Mesh Manager
|
|
1110
|
-
|
|
|
1162
|
+
| Integration | Option | Description |
|
|
1163
|
+
|-----------------------|------------------------------|---------------------------------------------------------------------------------------------------------------|
|
|
1164
|
+
| Data Mesh Manager | `--publish` | Push full results to the [Data Mesh Manager API](https://api.datamesh-manager.com/swagger/index.html) |
|
|
1165
|
+
| Data Contract Manager | `--publish` | Push full results to the [Data Contract Manager API](https://api.datacontract-manager.com/swagger/index.html) |
|
|
1166
|
+
| OpenTelemetry | `--publish-to-opentelemetry` | Push result as gauge metrics |
|
|
1111
1167
|
|
|
1112
1168
|
### Integration with Data Mesh Manager
|
|
1113
1169
|
|
|
1114
|
-
If you use [Data Mesh Manager](https://datamesh-manager.com/), you can use the data contract URL and append the `--publish` option to send and display the test results. Set an environment variable for your API key.
|
|
1170
|
+
If you use [Data Mesh Manager](https://datamesh-manager.com/) or [Data Contract Manager](https://datacontract-manager.com/), you can use the data contract URL and append the `--publish` option to send and display the test results. Set an environment variable for your API key.
|
|
1115
1171
|
|
|
1116
1172
|
```bash
|
|
1117
1173
|
# Fetch current data contract, execute tests on production, and publish result to data mesh manager
|
|
1118
1174
|
$ EXPORT DATAMESH_MANAGER_API_KEY=xxx
|
|
1119
|
-
$ datacontract test https://demo.datamesh-manager.com/demo279750347121/datacontracts/4df9d6ee-e55d-4088-9598-b635b2fdcbbc/datacontract.yaml
|
|
1175
|
+
$ datacontract test https://demo.datamesh-manager.com/demo279750347121/datacontracts/4df9d6ee-e55d-4088-9598-b635b2fdcbbc/datacontract.yaml \
|
|
1176
|
+
--server production \
|
|
1177
|
+
--publish https://api.datamesh-manager.com/api/test-results
|
|
1120
1178
|
```
|
|
1121
1179
|
|
|
1122
1180
|
### Integration with OpenTelemetry
|
|
@@ -1126,12 +1184,12 @@ If you use OpenTelemetry, you can use the data contract URL and append the `--pu
|
|
|
1126
1184
|
The metric name is "datacontract.cli.test.result" and it uses the following encoding for the result:
|
|
1127
1185
|
|
|
1128
1186
|
| datacontract.cli.test.result | Description |
|
|
1129
|
-
|
|
1130
|
-
| 0
|
|
1131
|
-
| 1
|
|
1132
|
-
| 2
|
|
1133
|
-
| 3
|
|
1134
|
-
| 4
|
|
1187
|
+
|------------------------------|---------------------------------------|
|
|
1188
|
+
| 0 | test run passed, no warnings |
|
|
1189
|
+
| 1 | test run has warnings |
|
|
1190
|
+
| 2 | test run failed |
|
|
1191
|
+
| 3 | test run not possible due to an error |
|
|
1192
|
+
| 4 | test status unknown |
|
|
1135
1193
|
|
|
1136
1194
|
|
|
1137
1195
|
```bash
|
|
@@ -1159,7 +1217,7 @@ Create a data contract based on the actual data. This is the fastest way to get
|
|
|
1159
1217
|
|
|
1160
1218
|
1. Use an existing physical schema (e.g., SQL DDL) as a starting point to define your logical data model in the contract. Double check right after the import whether the actual data meets the imported logical data model. Just to be sure.
|
|
1161
1219
|
```bash
|
|
1162
|
-
$ datacontract import --format sql ddl.sql
|
|
1220
|
+
$ datacontract import --format sql --source ddl.sql
|
|
1163
1221
|
$ datacontract test
|
|
1164
1222
|
```
|
|
1165
1223
|
|
|
@@ -1182,7 +1240,7 @@ Create a data contract based on the actual data. This is the fastest way to get
|
|
|
1182
1240
|
|
|
1183
1241
|
5. Set up a CI pipeline that executes daily and reports the results to the [Data Mesh Manager](https://datamesh-manager.com). Or to some place else. You can even publish to any opentelemetry compatible system.
|
|
1184
1242
|
```bash
|
|
1185
|
-
$ datacontract test --publish https://api.datamesh-manager.com/api/
|
|
1243
|
+
$ datacontract test --publish https://api.datamesh-manager.com/api/test-results
|
|
1186
1244
|
```
|
|
1187
1245
|
|
|
1188
1246
|
### Contract-First
|
|
@@ -1234,7 +1292,7 @@ Examples: adding models or fields
|
|
|
1234
1292
|
- Add the models or fields in the datacontract.yaml
|
|
1235
1293
|
- Increment the minor version of the datacontract.yaml on any change. Simply edit the datacontract.yaml for this.
|
|
1236
1294
|
- You need a policy that these changes are non-breaking. That means that one cannot use the star expression in SQL to query a table under contract. Make the consequences known.
|
|
1237
|
-
- Fail the build in the Pull Request if a datacontract.yaml
|
|
1295
|
+
- Fail the build in the Pull Request if a datacontract.yaml accidentally adds a breaking change even despite only a minor version change
|
|
1238
1296
|
```bash
|
|
1239
1297
|
$ datacontract breaking datacontract-from-pr.yaml datacontract-from-main.yaml
|
|
1240
1298
|
```
|
|
@@ -1292,7 +1350,7 @@ if __name__ == "__main__":
|
|
|
1292
1350
|
data_contract = DataContract(
|
|
1293
1351
|
data_contract_file="/path/datacontract.yaml"
|
|
1294
1352
|
)
|
|
1295
|
-
#
|
|
1353
|
+
# Call export
|
|
1296
1354
|
result = data_contract.export(
|
|
1297
1355
|
export_format="custom", model="orders", server="production", custom_arg="my_custom_arg"
|
|
1298
1356
|
)
|
|
@@ -1318,10 +1376,11 @@ Output
|
|
|
1318
1376
|
Using the importer factory to add a new custom importer
|
|
1319
1377
|
```python
|
|
1320
1378
|
|
|
1321
|
-
from datacontract.model.data_contract_specification import DataContractSpecification
|
|
1379
|
+
from datacontract.model.data_contract_specification import DataContractSpecification, Field, Model
|
|
1322
1380
|
from datacontract.data_contract import DataContract
|
|
1323
1381
|
from datacontract.imports.importer import Importer
|
|
1324
1382
|
from datacontract.imports.importer_factory import importer_factory
|
|
1383
|
+
|
|
1325
1384
|
import json
|
|
1326
1385
|
|
|
1327
1386
|
# Create a custom class that implements import_source method
|
|
@@ -1332,43 +1391,89 @@ class CustomImporter(Importer):
|
|
|
1332
1391
|
source_dict = json.loads(source)
|
|
1333
1392
|
data_contract_specification.id = source_dict.get("id_custom")
|
|
1334
1393
|
data_contract_specification.info.title = source_dict.get("title")
|
|
1394
|
+
data_contract_specification.info.version = source_dict.get("version")
|
|
1335
1395
|
data_contract_specification.info.description = source_dict.get("description_from_app")
|
|
1336
|
-
|
|
1396
|
+
|
|
1397
|
+
for model in source_dict.get("models", []):
|
|
1398
|
+
fields = {}
|
|
1399
|
+
for column in model.get('columns'):
|
|
1400
|
+
field = Field(
|
|
1401
|
+
description=column.get('column_description'),
|
|
1402
|
+
type=column.get('type')
|
|
1403
|
+
)
|
|
1404
|
+
fields[column.get('name')] = field
|
|
1405
|
+
|
|
1406
|
+
dc_model = Model(
|
|
1407
|
+
description=model.get('description'),
|
|
1408
|
+
fields= fields
|
|
1409
|
+
)
|
|
1410
|
+
|
|
1411
|
+
data_contract_specification.models[model.get('name')] = dc_model
|
|
1337
1412
|
return data_contract_specification
|
|
1338
|
-
|
|
1413
|
+
|
|
1339
1414
|
|
|
1340
1415
|
# Register the new custom class into factory
|
|
1341
1416
|
importer_factory.register_importer("custom_company_importer", CustomImporter)
|
|
1342
1417
|
|
|
1343
1418
|
|
|
1344
1419
|
if __name__ == "__main__":
|
|
1345
|
-
#
|
|
1346
|
-
json_from_custom_app = '
|
|
1420
|
+
# Get a custom data from other app
|
|
1421
|
+
json_from_custom_app = '''
|
|
1422
|
+
{
|
|
1423
|
+
"id_custom": "uuid-custom",
|
|
1424
|
+
"version": "0.0.2",
|
|
1425
|
+
"title": "my_custom_imported_data",
|
|
1426
|
+
"description_from_app": "Custom contract description",
|
|
1427
|
+
"models": [
|
|
1428
|
+
{
|
|
1429
|
+
"name": "model1",
|
|
1430
|
+
"desctiption": "model description from app",
|
|
1431
|
+
"columns": [
|
|
1432
|
+
{
|
|
1433
|
+
"name": "columnA",
|
|
1434
|
+
"type": "varchar",
|
|
1435
|
+
"column_description": "my_column description"
|
|
1436
|
+
},
|
|
1437
|
+
{
|
|
1438
|
+
"name": "columnB",
|
|
1439
|
+
"type": "varchar",
|
|
1440
|
+
"column_description": "my_columnB description"
|
|
1441
|
+
}
|
|
1442
|
+
]
|
|
1443
|
+
}
|
|
1444
|
+
]
|
|
1445
|
+
}
|
|
1446
|
+
'''
|
|
1347
1447
|
# Create a DataContract instance
|
|
1348
1448
|
data_contract = DataContract()
|
|
1349
1449
|
|
|
1350
|
-
#
|
|
1450
|
+
# Call import_from_source
|
|
1351
1451
|
result = data_contract.import_from_source(
|
|
1352
|
-
format="custom_company_importer",
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1452
|
+
format="custom_company_importer",
|
|
1453
|
+
data_contract_specification=DataContract.init(),
|
|
1454
|
+
source=json_from_custom_app
|
|
1455
|
+
)
|
|
1456
|
+
print(result.to_yaml() )
|
|
1356
1457
|
```
|
|
1357
1458
|
Output
|
|
1459
|
+
|
|
1460
|
+
```yaml
|
|
1461
|
+
dataContractSpecification: 0.9.3
|
|
1462
|
+
id: uuid-custom
|
|
1463
|
+
info:
|
|
1464
|
+
title: my_custom_imported_data
|
|
1465
|
+
version: 0.0.2
|
|
1466
|
+
description: Custom contract description
|
|
1467
|
+
models:
|
|
1468
|
+
model1:
|
|
1469
|
+
fields:
|
|
1470
|
+
columnA:
|
|
1471
|
+
type: varchar
|
|
1472
|
+
description: my_column description
|
|
1473
|
+
columnB:
|
|
1474
|
+
type: varchar
|
|
1475
|
+
description: my_columnB description
|
|
1358
1476
|
|
|
1359
|
-
```python
|
|
1360
|
-
{
|
|
1361
|
-
'dataContractSpecification': '0.9.3',
|
|
1362
|
-
'id': 'uuid-custom',
|
|
1363
|
-
'info': Info(title='my_custom_imported_data', version='0.0.1', status=None, description='Custom contract description', owner=None, contact=None),
|
|
1364
|
-
'servers': {},
|
|
1365
|
-
'terms': None,
|
|
1366
|
-
'models': {},
|
|
1367
|
-
'definitions': {},
|
|
1368
|
-
'examples': [],
|
|
1369
|
-
'quality': None,
|
|
1370
|
-
'servicelevels': None
|
|
1371
|
-
}
|
|
1372
1477
|
```
|
|
1373
1478
|
## Development Setup
|
|
1374
1479
|
|
|
@@ -1435,10 +1540,11 @@ repos:
|
|
|
1435
1540
|
|
|
1436
1541
|
### Available Hook IDs
|
|
1437
1542
|
|
|
1438
|
-
| Hook ID | Description
|
|
1439
|
-
| ----------------- |
|
|
1440
|
-
| datacontract-lint | Runs the lint subcommand.
|
|
1441
|
-
| datacontract-test | Runs the test subcommand. Please look at
|
|
1543
|
+
| Hook ID | Description | Dependency |
|
|
1544
|
+
| ----------------- | -------------------------------------------------- | ---------- |
|
|
1545
|
+
| datacontract-lint | Runs the lint subcommand. | Python3 |
|
|
1546
|
+
| datacontract-test | Runs the test subcommand. Please look at | Python3 |
|
|
1547
|
+
| | [test](#test) section for all available arguments. | |
|
|
1442
1548
|
|
|
1443
1549
|
## Release Steps
|
|
1444
1550
|
|
|
@@ -1456,13 +1562,15 @@ We are happy to receive your contributions. Propose your change in an issue or d
|
|
|
1456
1562
|
## Companies using this tool
|
|
1457
1563
|
|
|
1458
1564
|
- [INNOQ](https://innoq.com)
|
|
1565
|
+
- [Data Catering](https://data.catering/)
|
|
1459
1566
|
- And many more. To add your company, please create a pull request.
|
|
1460
1567
|
|
|
1461
1568
|
## Related Tools
|
|
1462
1569
|
|
|
1463
|
-
- [Data
|
|
1570
|
+
- [Data Contract Manager](https://www.datacontract-manager.com/) is a commercial tool to manage data contracts. It contains a web UI, access management, and data governance for a full enterprise data marketplace.
|
|
1464
1571
|
- [Data Contract GPT](https://gpt.datacontract.com) is a custom GPT that can help you write data contracts.
|
|
1465
1572
|
- [Data Contract Editor](https://editor.datacontract.com) is an editor for Data Contracts, including a live html preview.
|
|
1573
|
+
- [Data Contract Playground](https://data-catering.github.io/data-contract-playground/) allows you to validate and export your data contract to different formats within your browser.
|
|
1466
1574
|
|
|
1467
1575
|
## License
|
|
1468
1576
|
|