diff --git a/doc/source/whatsnew/v0.24.0.rst b/doc/source/whatsnew/v0.24.0.rst index 0b2b526dfe9e7..f33003e95d651 100644 --- a/doc/source/whatsnew/v0.24.0.rst +++ b/doc/source/whatsnew/v0.24.0.rst @@ -1492,6 +1492,7 @@ Notice how we now instead output ``np.nan`` itself instead of a stringified form - Bug in :func:`DataFrame.to_string()` that broke column alignment when ``index=False`` and width of first column's values is greater than the width of first column's header (:issue:`16839`, :issue:`13032`) - Bug in :func:`DataFrame.to_string()` that caused representations of :class:`DataFrame` to not take up the whole window (:issue:`22984`) - Bug in :func:`DataFrame.to_csv` where a single level MultiIndex incorrectly wrote a tuple. Now just the value of the index is written (:issue:`19589`). +- :func:`HDFStore` will raise ``ValueError`` when the ``format`` kwarg is passed to the constructor (:issue:`13291`) - Bug in :meth:`HDFStore.append` when appending a :class:`DataFrame` with an empty string column and ``min_itemsize`` < 8 (:issue:`12242`) - Bug in :func:`read_csv()` in which memory leaks occurred in the C engine when parsing ``NaN`` values due to insufficient cleanup on completion or error (:issue:`21353`) - Bug in :func:`read_csv()` in which incorrect error messages were being raised when ``skipfooter`` was passed in along with ``nrows``, ``iterator``, or ``chunksize`` (:issue:`23711`) diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py index 8132c458ce852..5b76b4bb3d6ab 100644 --- a/pandas/io/pytables.py +++ b/pandas/io/pytables.py @@ -458,6 +458,10 @@ class HDFStore(StringMixin): def __init__(self, path, mode=None, complevel=None, complib=None, fletcher32=False, **kwargs): + + if 'format' in kwargs: + raise ValueError('format is not a defined argument for HDFStore') + try: import tables # noqa except ImportError as ex: # pragma: no cover diff --git a/pandas/tests/io/test_pytables.py b/pandas/tests/io/test_pytables.py index 17f27e60ec28f..1c4d00c8b3e15 100644 --- a/pandas/tests/io/test_pytables.py +++ b/pandas/tests/io/test_pytables.py @@ -146,6 +146,11 @@ def teardown_method(self, method): @pytest.mark.filterwarnings("ignore:\\nPanel:FutureWarning") class TestHDFStore(Base): + def test_format_kwarg_in_constructor(self): + # GH 13291 + with ensure_clean_path(self.path) as path: + pytest.raises(ValueError, HDFStore, path, format='table') + def test_context(self): path = create_tempfile(self.path) try: