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

Read error from pytables #292

Closed
supriyom083 opened this Issue Aug 23, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@supriyom083

supriyom083 commented Aug 23, 2015

import numpy as np 
import tables as tb 
ndim = 600 
h5file = tb.openFile('test.h5', mode='w', title="Test Array") 
root = h5file.root
h5file.createArray(root, "test", np.zeros((ndim,ndim), dtype=float))    
h5file.close() 
from  odo import odo
odo('pytables://test.h5::/root/test','postgresql://postgresql:root@127.0.0.1::gg')
    C:\Anaconda\lib\site-packages\odo\backends\pytables.pyc in possibly_create_table(filename, dtype)
if datapath not in f: 
if dtype is None:
    raise ValueError('dshape cannot be None and datapath not'  ' in file')
else:
    ValueError: dshape can not be None and datapath not in file.

I am facing this strange issue while trying to import data from pytables

@cpcloud cpcloud self-assigned this Aug 23, 2015

@cpcloud cpcloud added this to the 0.3.4 milestone Aug 23, 2015

@cpcloud cpcloud added the question label Aug 23, 2015

@cpcloud

This comment has been minimized.

Member

cpcloud commented Aug 23, 2015

@supriyom083 Thanks for the report! I got to the bottom of this and there are two things at play here.

  1. The 'pytables://' string wasn't being properly removed from the input URI, so that's an actual bug.
  2. Shoving an array into a database doesn't make sense without the user providing the column names. This should raise a proper error message. I'll also add some documentation to the effect of "provide column names when shoving an array into a database table"

@cpcloud cpcloud added the bug label Aug 23, 2015

@cpcloud

This comment has been minimized.

Member

cpcloud commented Aug 23, 2015

@supriyom083 Also, thanks for providing a small, reproducible example. That really helped in getting to the bottom of this very quickly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment