-
Notifications
You must be signed in to change notification settings - Fork 10
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
update import and create-dataset shortcuts to require full path #217
Conversation
jsh2134
commented
Dec 20, 2017
•
edited
Loading
edited
- update the upload and create-dataset shortcuts to require a dataset full path (breaking change that removes --vault and --path) from those commands
- add validation code to objects and vaults and add some incomplete path inference
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.
Let's discuss tomorrow.
README.md
Outdated
@@ -234,11 +234,11 @@ remained unchanged. | |||
The `objects` property of a resource has been renamed `solve_objects`. | |||
|
|||
6. The `import` and `create-dataset` command-line utilities now require | |||
`--vault` and `--path` arguments. The `dataset` argument (`test-dataset` | |||
`--dataset_full_path` arguments. The `dataset` argument (`test-dataset` |
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.
isn't it --dataset-full-path ? maybe it should just be --full-path?
README.md
Outdated
below) no longer can contain slashes. | ||
|
||
``` | ||
create-dataset --capacity=small --vault=test --path=/ test-dataset | ||
create-dataset --capacity=small --dataset_ful_path=acme:test:/examples test-dataset |
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 a typo.
solvebio/cli/main.py
Outdated
@@ -103,8 +90,8 @@ class SolveArgumentParser(argparse.ArgumentParser): | |||
'Options are "append" (default) or "overwrite".' | |||
}, | |||
{ | |||
'name': 'dataset_name', | |||
'help': 'The name of the dataset' | |||
'name': 'dataset_full_path', |
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.
Maybe you should use 'flags': 'dataset-full-path'
? How about just full-path
?
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.
if we use flags, then what would the default be? or can you make flags required?
solvebio/cli/main.py
Outdated
@@ -158,26 +127,20 @@ class SolveArgumentParser(argparse.ArgumentParser): | |||
'medium (<500M), large (>=500M)' | |||
}, | |||
{ | |||
'name': 'dataset_name', | |||
'help': 'The name of the dataset' | |||
'name': 'dataset_full_path', |
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.
Same as above.
solvebio/cli/main.py
Outdated
'help': 'The name of the vault to use when ' | ||
'creating a new dataset (via --create-dataset), ' | ||
'defaults to your personal vault', | ||
}, | ||
{ | ||
'flags': '--path', |
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.
Maybe for consistency with other command line functions, this should also just be --full-path
?
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.
im fine with that.
solvebio/test/test_object.py
Outdated
test_cases = [ | ||
['{0}:myVault'.format(domain), '{0}:myVault:/'.format(domain)], | ||
['acme:myVault', 'acme:myVault:/'], | ||
['myVault', '{0}:/myVault'.format(user_vault)], |
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 we may want to raise an error in this case since it is pretty ambiguous...
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.
solvebio/test/test_object.py
Outdated
['acme:myVault', 'acme:myVault:/'], | ||
['myVault', '{0}:/myVault'.format(user_vault)], | ||
['acme:myVault:/uploads_folder', 'acme:myVault:/uploads_folder'], | ||
['acme:myVault:/uploads_folder', 'acme:myVault:/uploads_folder'], |
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.
dupe?
solvebio/test/test_object.py
Outdated
['myVault:/uploads_folder', '{0}:myVault:/uploads_folder'.format(domain)], # noqa | ||
['/uploads_folder', '{0}:/uploads_folder'.format(user_vault)], | ||
[':/uploads_folder', '{0}:/uploads_folder'.format(user_vault)], | ||
['myVault/uploads_folder', '{0}:/myVault/uploads_folder'.format(user_vault)], # noqa |
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.
raise error here too? We do that thing where if there is no slash it raises an error.
solvebio/cli/data.py
Outdated
vault_name = args.vault | ||
else: | ||
vault_name = Vault.get_personal_vault().name | ||
raise Exception( |
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.
didnt you remove this flag?
solvebio/cli/data.py
Outdated
else: | ||
vault_name = Vault.get_personal_vault().name | ||
if args.path: | ||
raise Exception( |
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.
removed?
solvebio/cli/data.py
Outdated
# | ||
if args.vault: | ||
raise Exception( | ||
'[Deprecated] --vault has been deprecated. Pass vault path as part of "full_path"' # noqa |
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.
remove?
* refactor full path validators with regex * fix issues with regexes and overrides; use explicit function names * switch to tilde for personal vault
solvebio/cli/data.py
Outdated
|
||
""" | ||
# FIXME: Does this need to be here? What about other commands? |
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 remove this?