-
Notifications
You must be signed in to change notification settings - Fork 235
feat(cli): add contract fetch command #2289
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
Conversation
for more information, see https://pre-commit.ci
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.
Very good stuff! Was not entirely sure about the "pull" terminology (as we don't have a "push" either) so maybe "fetch" or "get"? Don't feel strongly though.
for more information, see https://pre-commit.ci
|
@nielsn @m1n0 Thanks for reviewing. I addressed the changes suggested above.
Example usage:Command: soda contract fetch -d demo_unity_catalog/unity_catalog/tyler/obs_test_data -sc sc.yml -f /Users/adkinsty/PycharmProjects/soda-core-contracts/test/obs_test_data.yml Output:
Command: soda contract fetch -d demo_unity_catalog/unity_catalog/tyler/obs_test_data -sc sc.yml -f /Users/adkinsty/PycharmProjects/soda-core-contracts/test/obs_test_data.yml Output:
|
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.
very good, thanks!
Summary
As discussed on slack here, I thought it would be nice to have a
contract pull
command in soda core. So, I am proposing these changes to add such acontract pull
command. The command requires three arguments (-d
,-c
and-sc
) as described here:The command fetches the contract YAML strings from Soda Cloud for a given dataset and then writes these strings to the given YAML file paths. The command re-uses the same
soda_cloud_client.fetch_contract_for_dataset(dataset_identifier)
method used by thecontract verify
command.Example usage
Prints:
And then a new file is created at
/Users/adkinsty/PycharmProjects/soda-core-contracts/obs_test_data.yml
with the following contents: