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 error when a path outside project/data/[core|derived|discovered] is supplied #9

Closed hafen closed 5 years ago

hafen commented 5 years ago

With 0.0b3, when I try to push a file that is outside the project/data/[core|derived|discovered] location, I do get an error, but not until after the file is uploaded to Synapse. This should be checked prior to uploading the file.

Note that part of the checking of the file can also be used to automatically derive data_type, such that we don't need to ask the user for this.

Also, #8 will help avoid issues like this.

##################################################
 Uploading file to Synapse storage 
##################################################

Uploading [####################]100.00%   2.8kB/2.8kB  cppn.csv Done...
    Error in py_call_impl(callable, dots$args, dots$keywords) : 
  Exception: Existing project file found but does not match file path: /testproject/data/derived/cppn.csv : /tmp/cppn.csv

Detailed traceback: 
  File "kitools/project.py", line 291, in data_push
    project_file.abs_path, local_path))
pcstout commented 5 years ago

This has been fixed.