HDFStore.select_column #17912
Labels
Error Reporting
Incorrect or improved errors from pandas
good first issue
IO HDF5
read_hdf, HDFStore
Milestone
Code Sample, a copy-pastable example if possible
Let's select column from a non-existing dataframe in a HDFStore:
Problem description
We get an
AttributeError
becauseget_storer
returnsNone
:Is this intended?
Expected Output
The docstring says:
Shouldn't I expect a
KeyError
, then?It could be just this simple patch:
or should
get_storer
raise en exception in the first place?I'm new to Pandas/PyTables so I don't have the big picture.
From a caller perspective, I could to check first that the dataframe is in the store:
but I'd rather "ask forgiveness not permission",
so I should catch
AttributeError
but I'm not sure this exception being thrown is a design choice.I hope I'm being constructive and I don't sound like I'm nitpicking.
Output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.5.3.final.0
python-bits: 64
OS: Linux
OS-release: 4.9.0-4-amd64
machine: x86_64
processor:
byteorder: little
LC_ALL: None
LANG: fr_FR.UTF-8
LOCALE: fr_FR.UTF-8
pandas: 0.20.3
pytest: 3.2.3
pip: 9.0.1
setuptools: 36.6.0
Cython: None
numpy: 1.13.3
scipy: 0.19.1
xarray: None
IPython: None
sphinx: None
patsy: None
dateutil: 2.6.1
pytz: 2017.2
blosc: None
bottleneck: None
tables: 3.4.2
numexpr: 2.6.4
feather: None
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: 0.999999999
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.9.6
s3fs: None
pandas_gbq: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: