datacontract / datacontract-cli

CLI to manage your datacontract.yaml files
https://cli.datacontract.com
Other
352 stars 60 forks source link

Azure blob wildcard path not working #257

Open JonPipple opened 2 weeks ago

JonPipple commented 2 weeks ago

Hi, Documentation shows that a path with wildcard should work: image

However I get the following error: image

When I use the path of one specific .json file it does work but still shows "Server type azure not supported"

jochenchrist commented 2 weeks ago

Regarding "Server type azure not supported" The message "Server type azure not supported" warning refers to an additional JSON-Schema check that translates the data contract model to a JSON schema and makes a schema validation. This is currently not implemented for azure. https://github.com/datacontract/datacontract-cli/blob/main/datacontract/engines/fastjsonschema/check_jsonschema.py#L154

A pull request would be appreciated if you have some capacity.

jochenchrist commented 2 weeks ago

Regarding "type must be string, but is null"

Could you please paste a larger stack trace and probably paste the server definition (anonymized)?

JonPipple commented 2 weeks ago

Thanks for the quick responses!

This is the full output that I get: image

Server definition is as follow: image

jochenchrist commented 2 weeks ago

In your model (!), you use the field "data_type" for adm_nr. Can you try with renaming the field it to type.

JonPipple commented 2 weeks ago

Done, but get exactly the same error output

jochenchrist commented 2 weeks ago

Regarding "type must be string, but is number"

Hmm, now it is a different error message (type must be string, but is number). The errors comes from DuckDb while reading the JSON files. My current thesis is that the JSON files are inconsistent? Hard to debug without access to files.

Could you invest in debugging by trying to read the files directly in a Python Notebook using DuckDB https://duckdb.org/docs/data/json/overview.html