-
Notifications
You must be signed in to change notification settings - Fork 84
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/3911-cl-store infer storage type from url #4061
Conversation
Co-authored-by: Ashwin Ramaswami <[email protected]>
@wwwjn thanks, can you fix format? |
…eets into fix/3911-cl-store
Yes! It seems that after run pre-commit.sh, I mistakenly change a file. Fixed now! |
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.
Nice work! Small update to make the code cleaner
if args.url is not None: | ||
inferred_type = parse_linked_bundle_url(args.url).storage_type | ||
if args.storage_type is None: | ||
bundle_store_info["storage_type"] = inferred_type |
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 bundle_store_info["storage_type"] set when args.storage_type is specified?
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 think No? When storage_type is specified, it should have higher priority than inferred_type. And if a user use a wrong command like "--storage_type azure_blob --url gs://bucket", we will raise Error. If the args.storage_type is specified and equals inferred_type, it's ok not to set it.
Reasons for making this change
Fix issue #3911
Design choices
Infer storage type from url in bundle_cli.py rather than bundles.py line 514, because the field
storage_type
database modelBundleStoreSchema
can not be NULL, so we need to infer the storage type before insert into database. And we need to know the storage type as soon as possible so I put it in cl command.Changes
Related issues
#3911
Screenshots
N/A
Checklist