Unclear error when loading unsupported HDF5 file · Issue #9539 · pandas-dev/pandas (original) (raw)

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.