Skip to content
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

Fix bug that disallowed JSON flags in unity-catalog recipients update command. Added delta sharing CLI tests #549

Merged
merged 3 commits into from
Aug 29, 2022

Conversation

wchau
Copy link
Contributor

@wchau wchau commented Aug 25, 2022

Tested locally and through added tests.

Some other minor fixes:

  • Disallowed create provider without recipient profile
  • Rotate token expiration should be an integer, even though server can parse it fine. It makes the help text comprehensible.

@wchau wchau requested a review from pietern August 25, 2022 21:42
@codecov-commenter
Copy link

codecov-commenter commented Aug 25, 2022

Codecov Report

Merging #549 (30a6648) into main (8bf8310) will increase coverage by 5.30%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main     #549      +/-   ##
==========================================
+ Coverage   64.74%   70.04%   +5.30%     
==========================================
  Files          55       55              
  Lines        4731     4731              
==========================================
+ Hits         3063     3314     +251     
+ Misses       1668     1417     -251     
Impacted Files Coverage Δ
databricks_cli/unity_catalog/delta_sharing_cli.py 84.08% <ø> (+84.08%) ⬆️
databricks_cli/unity_catalog/uc_service.py 27.51% <0.00%> (-0.22%) ⬇️
databricks_cli/unity_catalog/metastore_cli.py 0.00% <0.00%> (ø)
databricks_cli/utils.py 93.75% <0.00%> (+4.16%) ⬆️
databricks_cli/unity_catalog/utils.py 46.15% <0.00%> (+15.38%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@pietern
Copy link
Contributor

pietern commented Aug 26, 2022

The flag defaults to None though (in the @click.option above). Do you see something else?

@pietern
Copy link
Contributor

pietern commented Aug 26, 2022

It would be great if you can add a test for this. Looking at the implementation is also does a couple other unexpected things; like update the comment and and owner to nothing if they aren't specified. With a couple tests this could have been caught.

cc @adamcain-db

@wchau
Copy link
Contributor Author

wchau commented Aug 27, 2022

It would be great if you can add a test for this. Looking at the implementation is also does a couple other unexpected things; like update the comment and and owner to nothing if they aren't specified. With a couple tests this could have been caught.

cc @adamcain-db

Add tests for all delta sharing CLI commands. Those things are expected; the nulls will not negate the fields.

@wchau wchau changed the title Fix bug that disallowed JSON flags in unity-catalog recipients update command Fix bug that disallowed JSON flags in unity-catalog recipients update command. Added delta sharing CLI tests Aug 27, 2022
Copy link
Contributor

@pietern pietern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding tests!

Those things are expected; the nulls will not negate the fields.

Understood. This is not what I would expect though, and what other APIs implement. Typically null means remove the field, per https://datatracker.ietf.org/doc/html/rfc7386.

@pietern pietern merged commit 375af9d into databricks:main Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants