ki-tools / kitools-py

Tools for working with data in Ki analyses
Apache License 2.0
3 stars 0 forks source link

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

Open hafen opened 5 years ago

hafen commented 5 years ago

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 commented 5 years ago

@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 commented 5 years ago

Yes this is better.

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