Skip to content

Commit e94e6ec

Browse files
authored
Merge pull request #5 from datacontract/main
refresh for original repos
2 parents becc253 + 0dc8b61 commit e94e6ec

79 files changed

Lines changed: 4923 additions & 1735 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 74 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,80 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313

1414
### Fixed
1515

16-
- Fix to handle logicalType format wrt avro mentioned in issue #687
16+
## [0.10.28] - 2025-06-05
17+
18+
### Added
19+
- Much better ODCS support
20+
- Import anything to ODCS via the `import --spec odcs` flag
21+
- Export to HTML with an ODCS native template via `export --format html`
22+
- Export to Mermaid with an ODCS native mapping via `export --format mermaid`
23+
- The databricks `unity` importer now supports more than a single table. You can use `--unity-table-full-name` multiple times to import multiple tables. And it will automatically add a server with the catalog and schema name.
24+
25+
### Changed
26+
- `datacontract catalog [OPTIONS]`: Added version to contract cards in `index.html` of the catalog (enabled search by version)
27+
- The type mapping of the `unity` importer no uses the native databricks types instead of relying on spark types. This allows for better type mapping and more accurate data contracts.
28+
29+
### Fixed
30+
31+
## [0.10.27] - 2025-05-22
32+
33+
### Added
34+
35+
- `datacontract export --format mermaid` Export
36+
to [Mermaid](https://mermaid-js.github.io/mermaid/#/) (#767, #725)
37+
38+
### Changed
39+
40+
- `datacontract export --format html`: Adding the mermaid figure to the html export
41+
- `datacontract export --format odcs`: Export physical type to ODCS if the physical type is
42+
configured in config object
43+
- `datacontract import --format spark`: Added support for spark importer table level comments (#761)
44+
- `datacontract import` respects `--owner` and `--id` flags (#753)
45+
46+
### Fixed
47+
48+
- `datacontract export --format sodacl`: Fix resolving server when using `--server` flag (#768)
49+
- `datacontract export --format dbt`: Fixed DBT export behaviour of constraints to default to data tests when no model type is specified in the datacontract model
50+
51+
52+
## [0.10.26] - 2025-05-16
53+
54+
### Changed
55+
- Databricks: Add support for Variant type (#758)
56+
- `datacontract export --format odcs`: Export physical type if the physical type is configured in
57+
config object (#757)
58+
- `datacontract export --format sql` Include datacontract descriptions in the Snowflake sql export (
59+
#756)
60+
61+
## [0.10.25] - 2025-05-07
62+
63+
### Added
64+
- Extracted the DataContractSpecification and the OpenDataContractSpecification in separate pip modules and use them in the CLI.
65+
- `datacontract import --format excel`: Import from Excel
66+
template https://github.com/datacontract/open-data-contract-standard-excel-template (#742)
67+
68+
## [0.10.24] - 2025-04-19
69+
70+
### Added
71+
72+
- `datacontract test` with DuckDB: Deep nesting of json objects in duckdb (#681)
73+
74+
### Changed
75+
76+
- `datacontract import --format csv` produces more descriptive output. Replaced
77+
using clevercsv with duckdb for loading and sniffing csv file.
78+
- Updated dependencies
79+
80+
### Fixed
81+
82+
- Fix to handle logicalType format wrt avro mentioned in issue (#687)
83+
- Fix field type from TIME to DATETIME in BigQuery converter and schema (#728)
84+
- Fix encoding issues. (#712)
85+
- ODCS: Fix required in export and added item and fields format (#724)
86+
87+
### Removed
88+
89+
- Deprecated QualityLinter is now removed
1790

1891
## [0.10.23] - 2025-03-03
1992

README.md

Lines changed: 402 additions & 384 deletions
Large diffs are not rendered by default.

datacontract/api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ async def test(
162162
server: Annotated[
163163
str | None,
164164
Query(
165-
example="production",
165+
examples=["production"],
166166
description="The server name to test. Optional, if there is only one server.",
167167
),
168168
] = None,
@@ -191,7 +191,7 @@ async def lint(
191191
schema: Annotated[
192192
str | None,
193193
Query(
194-
example="https://datacontract.com/datacontract.schema.json",
194+
examples=["https://datacontract.com/datacontract.schema.json"],
195195
description="The schema to use for validation. This must be a URL.",
196196
),
197197
] = None,
@@ -220,7 +220,7 @@ def export(
220220
server: Annotated[
221221
str | None,
222222
Query(
223-
example="production",
223+
examples=["production"],
224224
description="The server name to export. Optional, if there is only one server.",
225225
),
226226
] = None,

datacontract/catalog/catalog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from jinja2 import Environment, PackageLoader, select_autoescape
77

88
from datacontract.data_contract import DataContract
9-
from datacontract.export.html_export import get_version
9+
from datacontract.export.html_exporter import get_version
1010
from datacontract.model.data_contract_specification import DataContractSpecification
1111

1212

datacontract/cli.py

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
from datacontract.catalog.catalog import create_data_contract_html, create_index_html
1313
from datacontract.data_contract import DataContract, ExportFormat
14-
from datacontract.imports.importer import ImportFormat
14+
from datacontract.imports.importer import ImportFormat, Spec
1515
from datacontract.init.init_template import get_init_template
1616
from datacontract.integration.datamesh_manager import (
1717
publish_data_contract_to_datamesh_manager,
@@ -126,7 +126,8 @@ def test(
126126
"servers (default)."
127127
),
128128
] = "all",
129-
publish: Annotated[str, typer.Option(help="The url to publish the results after the test")] = None,
129+
publish_test_results: Annotated[bool, typer.Option(help="Publish the results after the test")] = False,
130+
publish: Annotated[str, typer.Option(help="DEPRECATED. The url to publish the results after the test.")] = None,
130131
output: Annotated[
131132
Path,
132133
typer.Option(
@@ -149,6 +150,7 @@ def test(
149150
run = DataContract(
150151
data_contract_file=location,
151152
schema_location=schema,
153+
publish_test_results=publish_test_results,
152154
publish_url=publish,
153155
server=server,
154156
ssl_verification=ssl_verification,
@@ -244,8 +246,12 @@ def import_(
244246
] = None,
245247
source: Annotated[
246248
Optional[str],
247-
typer.Option(help="The path to the file or Glue Database that should be imported."),
249+
typer.Option(help="The path to the file that should be imported."),
248250
] = None,
251+
spec: Annotated[
252+
Spec,
253+
typer.Option(help="The format of the data contract to import. "),
254+
] = Spec.datacontract_specification,
249255
dialect: Annotated[
250256
Optional[str],
251257
typer.Option(help="The SQL dialect to use when importing SQL files, e.g., postgres, tsql, bigquery."),
@@ -265,7 +271,7 @@ def import_(
265271
),
266272
] = None,
267273
unity_table_full_name: Annotated[
268-
Optional[str], typer.Option(help="Full name of a table in the unity catalog")
274+
Optional[List[str]], typer.Option(help="Full name of a table in the unity catalog")
269275
] = None,
270276
dbt_model: Annotated[
271277
Optional[List[str]],
@@ -297,13 +303,22 @@ def import_(
297303
str,
298304
typer.Option(help="The location (url or path) of the Data Contract Specification JSON Schema"),
299305
] = None,
306+
owner: Annotated[
307+
Optional[str],
308+
typer.Option(help="The owner or team responsible for managing the data contract."),
309+
] = None,
310+
id: Annotated[
311+
Optional[str],
312+
typer.Option(help="The identifier for the the data contract."),
313+
] = None,
300314
):
301315
"""
302316
Create a data contract from the given source location. Saves to file specified by `output` option if present, otherwise prints to stdout.
303317
"""
304318
result = DataContract().import_from_source(
305319
format=format,
306320
source=source,
321+
spec=spec,
307322
template=template,
308323
schema=schema,
309324
dialect=dialect,
@@ -316,6 +331,8 @@ def import_(
316331
dbml_schema=dbml_schema,
317332
dbml_table=dbml_table,
318333
iceberg_table=iceberg_table,
334+
owner=owner,
335+
id=id,
319336
)
320337
if output is None:
321338
console.print(result.to_yaml(), markup=False, soft_wrap=True)

0 commit comments

Comments
 (0)