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

HDFStore - raising an exception when complevel > 0 and complib is None #15943

Closed
joonro opened this issue Apr 7, 2017 · 5 comments · Fixed by #16355
Closed

HDFStore - raising an exception when complevel > 0 and complib is None #15943

joonro opened this issue Apr 7, 2017 · 5 comments · Fixed by #16355
Labels
Error Reporting Incorrect or improved errors from pandas IO HDF5 read_hdf, HDFStore
Milestone

Comments

@joonro
Copy link

joonro commented Apr 7, 2017

Code Sample, a copy-pastable example if possible

HDFStore = pd.HDFStore('mydata.ph5', mode='w', complevel=9)

Problem description

Hi,

It seems when complib is None, pd.HDFStore does not use any compression even though a user supplies complevel > 0. If there is no good default option for complib, then in my opinion, HDFStore should raise an exception when (complib is None) and (complevel > 0) instead. This is because clearly the user wants compression but it cannot be done - I think explicitly raising an exception is better than silently ignoring the option.

Output of pd.show_versions()

pd.show_versions()

INSTALLED VERSIONS

commit: None
python: 3.5.2.final.0
python-bits: 64
OS: Windows
OS-release: 10
machine: AMD64
processor: Intel64 Family 6 Model 62 Stepping 4, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
LOCALE: None.None

pandas: 0.19.2
nose: 1.3.7
pip: 9.0.1
setuptools: 27.2.0
Cython: 0.24.1
numpy: 1.11.3
scipy: 0.18.1
statsmodels: 0.6.1
xarray: 0.9.1
IPython: 5.1.0
sphinx: 1.4.6
patsy: 0.4.1
dateutil: 2.5.3
pytz: 2016.6.1
blosc: None
bottleneck: 1.1.0
tables: 3.2.2
numexpr: 2.6.1
matplotlib: 1.5.3
openpyxl: 2.3.2
xlrd: 1.0.0
xlwt: 1.1.2
xlsxwriter: 0.9.3
lxml: 3.6.4
bs4: 4.5.1
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.13
pymysql: None
psycopg2: None
jinja2: 2.8
boto: 2.42.0
pandas_datareader: None

@jreback
Copy link
Contributor

jreback commented Apr 7, 2017

xref to #14478

@jreback
Copy link
Contributor

jreback commented Apr 7, 2017

for sure would take bug fixes around this (and related issues)!. please make sure to have tests!

@jreback jreback added Error Reporting Incorrect or improved errors from pandas IO HDF5 read_hdf, HDFStore labels Apr 7, 2017
@jreback jreback added this to the Next Major Release milestone Apr 7, 2017
@joonro
Copy link
Author

joonro commented Apr 10, 2017

I see - thanks for the pointers!

@linebp
Copy link
Contributor

linebp commented Apr 24, 2017

If no-one is working on this, I can give it a try?

I looked at the __init__ in class HDFStore and #14478. Can the default in default_complib in pytables tables.filters module be used as a default value here too? If this is the way to go, it is perhaps best to fix #14478 first (avoiding the possible issue of using a default that is not otherwise an option)?

Maybe an exception or some pandas defined default value is the way to go instead?

Where would the tests for this belong?

@jreback
Copy link
Contributor

jreback commented Apr 24, 2017

this is orthogonal to #14478 though easy enough to fix both. tests are in pandas/tests/io/test_pytables.py

@jreback jreback modified the milestones: 0.21.0, Next Major Release May 17, 2017
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.

3 participants