datacontract-cli 0.10.30__py3-none-any.whl → 0.10.31__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.
Potentially problematic release.
This version of datacontract-cli might be problematic. Click here for more details.
- datacontract/export/spark_converter.py +3 -1
- datacontract/imports/sql_importer.py +2 -0
- datacontract/imports/unity_importer.py +2 -1
- {datacontract_cli-0.10.30.dist-info → datacontract_cli-0.10.31.dist-info}/METADATA +1 -4
- {datacontract_cli-0.10.30.dist-info → datacontract_cli-0.10.31.dist-info}/RECORD +9 -9
- {datacontract_cli-0.10.30.dist-info → datacontract_cli-0.10.31.dist-info}/WHEEL +0 -0
- {datacontract_cli-0.10.30.dist-info → datacontract_cli-0.10.31.dist-info}/entry_points.txt +0 -0
- {datacontract_cli-0.10.30.dist-info → datacontract_cli-0.10.31.dist-info}/licenses/LICENSE +0 -0
- {datacontract_cli-0.10.30.dist-info → datacontract_cli-0.10.31.dist-info}/top_level.txt +0 -0
|
@@ -126,6 +126,8 @@ def to_spark_data_type(field: Field) -> types.DataType:
|
|
|
126
126
|
return types.StructType(to_struct_type(field.fields))
|
|
127
127
|
if field_type == "map":
|
|
128
128
|
return types.MapType(to_spark_data_type(field.keys), to_spark_data_type(field.values))
|
|
129
|
+
if field_type == "variant":
|
|
130
|
+
return types.VariantType()
|
|
129
131
|
if field_type in ["string", "varchar", "text"]:
|
|
130
132
|
return types.StringType()
|
|
131
133
|
if field_type in ["number", "decimal", "numeric"]:
|
|
@@ -150,7 +152,7 @@ def to_spark_data_type(field: Field) -> types.DataType:
|
|
|
150
152
|
return types.DateType()
|
|
151
153
|
if field_type == "bytes":
|
|
152
154
|
return types.BinaryType()
|
|
153
|
-
return types.
|
|
155
|
+
return types.StringType() # default if no condition is met
|
|
154
156
|
|
|
155
157
|
|
|
156
158
|
def print_schema(dtype: types.DataType) -> str:
|
|
@@ -230,6 +230,8 @@ def map_type_from_sql(sql_type: str) -> str | None:
|
|
|
230
230
|
return "int"
|
|
231
231
|
elif sql_type_normed.startswith("float"):
|
|
232
232
|
return "float"
|
|
233
|
+
elif sql_type_normed.startswith("double"):
|
|
234
|
+
return "double"
|
|
233
235
|
elif sql_type_normed.startswith("decimal"):
|
|
234
236
|
return "decimal"
|
|
235
237
|
elif sql_type_normed.startswith("numeric"):
|
|
@@ -200,7 +200,8 @@ def import_table_fields(columns: List[ColumnInfo]) -> dict[str, Field]:
|
|
|
200
200
|
|
|
201
201
|
def _to_field(column: ColumnInfo) -> Field:
|
|
202
202
|
field = Field()
|
|
203
|
-
|
|
203
|
+
# The second condition evaluates for complex types (e.g. variant)
|
|
204
|
+
if column.type_name is not None or (column.type_name is None and column.type_text is not None):
|
|
204
205
|
sql_type = str(column.type_text)
|
|
205
206
|
field.type = map_type_from_sql(sql_type)
|
|
206
207
|
physical_type_key = to_physical_type_key("databricks")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: datacontract-cli
|
|
3
|
-
Version: 0.10.
|
|
3
|
+
Version: 0.10.31
|
|
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
|
License-Expression: MIT
|
|
@@ -1018,8 +1018,6 @@ If using Databricks, and an error is thrown when trying to deploy the SQL DDLs w
|
|
|
1018
1018
|
|
|
1019
1019
|
```shell
|
|
1020
1020
|
spark.conf.set(“spark.databricks.delta.schema.typeCheck.enabled”, “false”)
|
|
1021
|
-
from datacontract.model import data_contract_specification
|
|
1022
|
-
data_contract_specification.DATACONTRACT_TYPES.append(“variant”)
|
|
1023
1021
|
```
|
|
1024
1022
|
|
|
1025
1023
|
#### Great Expectations
|
|
@@ -2083,7 +2081,6 @@ We are happy to receive your contributions. Propose your change in an issue or d
|
|
|
2083
2081
|
- [INNOQ](https://innoq.com)
|
|
2084
2082
|
- [Data Catering](https://data.catering/)
|
|
2085
2083
|
- [Oliver Wyman](https://www.oliverwyman.com/)
|
|
2086
|
-
- [dmTECH](https://www.dmtech.tech/de)
|
|
2087
2084
|
- And many more. To add your company, please create a pull request.
|
|
2088
2085
|
|
|
2089
2086
|
## Related Tools
|
|
@@ -49,7 +49,7 @@ datacontract/export/protobuf_converter.py,sha256=DHLl8BW26xqltBsd7Qhz0RhTl9YZQKC
|
|
|
49
49
|
datacontract/export/pydantic_converter.py,sha256=1Lt9F8i6zyQYb44MyQtsXwCWWXYxZ47SmzArr_uPqsU,5579
|
|
50
50
|
datacontract/export/rdf_converter.py,sha256=1aTe_fwBRBnYUrJZzhEQ8eVnl0mQ1hcF45aKVdgvSIc,6435
|
|
51
51
|
datacontract/export/sodacl_converter.py,sha256=75vQ2TnoLfjiDtWT2x8opumvotXVRs1YaIu1NLYz05M,1473
|
|
52
|
-
datacontract/export/spark_converter.py,sha256=
|
|
52
|
+
datacontract/export/spark_converter.py,sha256=c4C_QZFRQLMW6Cz35WYdHqYGKyHSF7bBVmJua2YF0Cs,7290
|
|
53
53
|
datacontract/export/sql_converter.py,sha256=vyLbDqzt_J3LRXpPv2W2HqUIyAtQx_S-jviBiSxh14A,5087
|
|
54
54
|
datacontract/export/sql_type_converter.py,sha256=4r8S7nb4z2ODgXTwHxdtU158HWE8uxXHydiZ_y4-N_E,13592
|
|
55
55
|
datacontract/export/sqlalchemy_converter.py,sha256=0DMncvA811lTtd5q4ZORREQ9YH1vQm1lJeqMWsFvloE,6463
|
|
@@ -71,8 +71,8 @@ datacontract/imports/odcs_v3_importer.py,sha256=smtFSoywNojUCdB8sDu0e_3yHN4CmUw5
|
|
|
71
71
|
datacontract/imports/parquet_importer.py,sha256=W_0_16mX4stwDUt4GM2L7dnGmTpAySab5k13-OlTCCc,3095
|
|
72
72
|
datacontract/imports/protobuf_importer.py,sha256=rlUIskv9PNi5rFQ4Hobt9zlnKpahGsb4dy5G5UJoVAw,10840
|
|
73
73
|
datacontract/imports/spark_importer.py,sha256=vqGM3kisQGSiHS1AvuC6gp0unj2-6TT3R-ejG96j-Tw,8618
|
|
74
|
-
datacontract/imports/sql_importer.py,sha256=
|
|
75
|
-
datacontract/imports/unity_importer.py,sha256=
|
|
74
|
+
datacontract/imports/sql_importer.py,sha256=CfHap1zpyy-NVol_i21bDai3l4PD8OLuJQwaVlihbqg,9543
|
|
75
|
+
datacontract/imports/unity_importer.py,sha256=iW4CJNbHNoQR5fqVlBJfdHnbbDasPgkwHHmyV9FKGkI,8687
|
|
76
76
|
datacontract/init/init_template.py,sha256=nc-B2ZkwDQ3GNFqxNmSDcStQMDbBTxysgTZDLw15izo,721
|
|
77
77
|
datacontract/integration/datamesh_manager.py,sha256=FT9eadzFz181lg54b49_c_x2caGJT7mR3drlZBSBJLo,3375
|
|
78
78
|
datacontract/lint/files.py,sha256=tg0vq_w4LQsEr_8A5qr4hUJmHeGalUpsXJXC1t-OGC0,471
|
|
@@ -112,9 +112,9 @@ datacontract/templates/partials/model_field.html,sha256=2YBF95ypNCPFYuYKoeilRnDG
|
|
|
112
112
|
datacontract/templates/partials/quality.html,sha256=ynEDWRn8I90Uje-xhGYgFcfwOgKI1R-CDki-EvTsauQ,1785
|
|
113
113
|
datacontract/templates/partials/server.html,sha256=dHFJtonMjhiUHtT69RUgTpkoRwmNdTRzkCdH0LtGg_4,6279
|
|
114
114
|
datacontract/templates/style/output.css,sha256=ioIo1f96VW7LHhDifj6QI8QbRChJl-LlQ59EwM8MEmA,28692
|
|
115
|
-
datacontract_cli-0.10.
|
|
116
|
-
datacontract_cli-0.10.
|
|
117
|
-
datacontract_cli-0.10.
|
|
118
|
-
datacontract_cli-0.10.
|
|
119
|
-
datacontract_cli-0.10.
|
|
120
|
-
datacontract_cli-0.10.
|
|
115
|
+
datacontract_cli-0.10.31.dist-info/licenses/LICENSE,sha256=23h64qnSeIZ0DKeziWAKC-zBCt328iSbRbWBrXoYRb4,2210
|
|
116
|
+
datacontract_cli-0.10.31.dist-info/METADATA,sha256=T5pyKhT8TWagt86un_b7JSYYN2BLtpLKTvK5kRpOCeg,110144
|
|
117
|
+
datacontract_cli-0.10.31.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
118
|
+
datacontract_cli-0.10.31.dist-info/entry_points.txt,sha256=D3Eqy4q_Z6bHauGd4ppIyQglwbrm1AJnLau4Ppbw9Is,54
|
|
119
|
+
datacontract_cli-0.10.31.dist-info/top_level.txt,sha256=VIRjd8EIUrBYWjEXJJjtdUgc0UAJdPZjmLiOR8BRBYM,13
|
|
120
|
+
datacontract_cli-0.10.31.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|