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

Unclear error when loading unsupported HDF5 file #9539

Closed
mangecoeur opened this issue Feb 24, 2015 · 2 comments · Fixed by #33509
Closed

Unclear error when loading unsupported HDF5 file #9539

mangecoeur opened this issue Feb 24, 2015 · 2 comments · Fixed by #33509
Labels
Error Reporting Incorrect or improved errors from pandas IO HDF5 read_hdf, HDFStore
Milestone

Comments

@mangecoeur
Copy link
Contributor

Backstory - I created some H5 files with h5py containing large 3D arrays (not python dataframes). Then I forgot this and tried to load with Pandas. Since they didn't contain real dataframes the load understandably failed. However the error thrown was:

TypeError: cannot create a storer if the object is not existing nor a value are passed

(line 1148 in pandas.io.pytables) which apart from being awkward grammar (rather cannot create a storer if the object does not exist nor a value given) doesn't suggest anything about the h5 file not being supported.

Since passing around h5 files is fairly common and sometimes they contain tables and sometimes not, it would be nice if Pandas warned you clearly that the object you are trying to load isn't a pandas-compatible table.

@jreback jreback added Error Reporting Incorrect or improved errors from pandas IO HDF5 read_hdf, HDFStore labels Feb 24, 2015
@jreback
Copy link
Contributor

jreback commented Feb 24, 2015

certainly willing to take a PR to make the error message more clear.

Unfortuntately reading h5py is pretty out of scope as its a non-easily interpretable format and doesn't have much meta data.

That said, you can use into to do this, something like

into('hdfstore:://file.hdf','h5py:://file.h5') will do the conversion (only will work with a 1/2-D array-like though)

@mangecoeur
Copy link
Contributor Author

I agree there's no need to read h5py directly, just a more clear error. Will have a look if I get time...

-----Original Message-----
From: "jreback" notifications@github.com
Sent: ‎24/‎02/‎2015 21:26
To: "pydata/pandas" pandas@noreply.github.com
Cc: "mangecoeur" jon.chambers3001@gmail.com
Subject: Re: [pandas] Unclear error when loading unsupported HDF5 file (#9539)

certainly willing to take a PR to make the error message more clear.
Unfortuntately reading h5py is pretty out of scope as its a non-easily interpretable format and doesn't have much meta data.
That said, you can use into to do this, something like
into('hdfstore:file.hdf','h5py:file.h5') will do the conversion

Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Error Reporting Incorrect or improved errors from pandas IO HDF5 read_hdf, HDFStore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants