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

data_push should have a more clear message when file does not exist #3

Open
hafen opened this issue Feb 27, 2019 · 2 comments
Open

Comments

@hafen
Copy link
Member

hafen commented Feb 27, 2019

The error message for data_push when a file doesn't exist isn't very clear. I get the same error when a file doesn't exist as when I try to push a directory (see #2). The error is:

ValueError: local_path must be a file.

It would be nice if the error message indicated that the file does not exist.

@pcstout
Copy link
Member

pcstout commented Mar 22, 2019

@hafen Is this better?

>>> p.data_add('/tmp/does_not_exist.csv')
ValueError: Please specify a remote URI or a local file or folder path that exists.

>>> p.data_pull('/tmp/does_not_exist.csv')
kitools.exceptions.KiProjectResourceNotFoundError: No project resource found matching: /tmp/does_not_exist.csv

>>> p.data_push('/tmp/does_not_exist.csv')
kitools.exceptions.KiProjectResourceNotFoundError: No project resource found matching: /tmp/does_not_exist.csv

@hafen
Copy link
Member Author

hafen commented Mar 22, 2019

Yes this is better.

For data_push() and data_pull(), what do you think of adding two hints:

  • Use data_list() to look at the remote URI or name for valid resources.
  • If the resource you want to push/pull is not in this list, add it with data_add().

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

No branches or pull requests

2 participants