-
Notifications
You must be signed in to change notification settings - Fork 233
Add more configurable flags for UC metastore, external locations, and storage credentials. #562
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
|
@adamcain-db Could you take a pass? |
pietern
left a comment
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
@adamcain-db Will defer approval to you. I'll take care of merge and release when done.
adamcain-db
left a comment
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. Just some questions about input validation.
Thanks for adding all these flags and also the unit tests!
| data = { | ||
| 'name': name, | ||
| 'comment': comment | ||
| } |
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.
Looks like we are leaving it completely to the server to validate the input -- e.g., we are not checking that data has required fields like name. I suppose that's reasonable (as we also do not validate JSON inputs), but I wanted to confirm that this is our approach for input validation at the CLI.
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.
Yes, that's the idea. Instead of replicating the full validation logic, just letting the server do it and then return the error message would make things easier to maintain.
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.
Makes sense.
| help='Path URL for the new external location') | ||
| @click.option('--storage-credential-name', default=None, | ||
| help='Name of storage credential to use with new external location') | ||
| @click.option('--read-only/--no-read-only', is_flag=True, default=None, |
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.
Wow! I'm thrilled that when the data dict has fields like 'read_only': None, the JSON sent has "read_only": null and then the server sees that field omitted. Party on, Garth....
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.
Null magic!
| cred_az_application_id, cred_az_client_secret, | ||
| cred_az_mi_access_connector_id, | ||
| cred_az_mi_id, cred_gcp_sak_email, cred_gcp_sak_private_key_id, | ||
| cred_gcp_sak_private_key): |
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.
No biggie, but I wonder if this CLI should be validate_storage_credential. It still requires a url, of course, but the CLI name would at least match the API endpoint. Eh, just a thought...
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.
Yeah, I am not sure why it's named differently, but unfortunately, renaming a command is more trouble than it's worth. If we want to, it should be in a different PR with proper deprecation patterns.
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.
Agreed.
| 'The service account\'s RSA private key.')) | ||
| @click.option('--comment', default=None, | ||
| help='Free-form text description.') | ||
| @create_update_common_options |
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.
Slick!
Added all configurable flags for create and update operations.
Added unit tests for all CLI commands relevant to the 3 securables.
Added .vscode folder to automatically configure lint and pytest.
Included GCP credentials in preparation for private preview.
Manually tested with a handful of commands.