-
Notifications
You must be signed in to change notification settings - Fork 135
Adding json format for import #766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
mathispernias
commented
May 20, 2025
- Tests pass
- ruff format
- README.md updated (if relevant)
- CHANGELOG.md entry added
CHANGELOG.md
Outdated
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
## [0.10.25] - 2025-05-07 | |||
|
|||
### Added | |||
- `datacontract import --format json`: Import from JSON files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move this to
Unreleased
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!
mermaid2.html
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does not belong here, does it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my mistake i removed this file
query
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed it!
tests/datacontract.yaml
Outdated
@@ -0,0 +1,216 @@ | |||
dataContractSpecification: 1.1.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this datacontract.yaml used?
Why has it such as generic name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I forgot to remove it, it's done!
@@ -0,0 +1,5002 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please move these files to a subdirectory fixtures/import/json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay it's done
@@ -0,0 +1,2301 @@ | |||
dataContractSpecification: 1.1.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please rename to product_detail.datacontract.yaml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I renamed it
@@ -0,0 +1,317 @@ | |||
dataContractSpecification: 1.1.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please rename to productsimple.datacontract.yaml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I renamed it
This implementation looks like it supports JSON files with single structures. Can you please make sure that the JSON importer also supports JSON documents with multiple entries? |
The JSON importer can now also takes NDJSON (Newline-delimited JSON). |
I like it. Can you make the test jsons a little smaller? And make sure the test jsons and their imported contracts have the same file prefix. |
I updated the JSON tests to include three cases—simple JSON, complex JSON, and NDJSON— I also changed the file prefix. |
datacontract/export/odps_export.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for your contribution