Skip to content

Commit 949b148

Browse files
CianciuStylesjreback
authored andcommitted
BUG: Raise ValueError when the format kwarg is passed to the HDFStore constructor (#24155)
1 parent 07cc3be commit 949b148

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

doc/source/whatsnew/v0.24.0.rst

+1
Original file line numberDiff line numberDiff line change
@@ -1465,6 +1465,7 @@ Notice how we now instead output ``np.nan`` itself instead of a stringified form
14651465
- 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`)
14661466
- Bug in :func:`DataFrame.to_string()` that caused representations of :class:`DataFrame` to not take up the whole window (:issue:`22984`)
14671467
- 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`).
1468+
- :func:`HDFStore` will raise ``ValueError`` when the ``format`` kwarg is passed to the constructor (:issue:`13291`)
14681469
- Bug in :meth:`HDFStore.append` when appending a :class:`DataFrame` with an empty string column and ``min_itemsize`` < 8 (:issue:`12242`)
14691470
- 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`)
14701471
- 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`)

pandas/io/pytables.py

+4
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,10 @@ class HDFStore(StringMixin):
458458

459459
def __init__(self, path, mode=None, complevel=None, complib=None,
460460
fletcher32=False, **kwargs):
461+
462+
if 'format' in kwargs:
463+
raise ValueError('format is not a defined argument for HDFStore')
464+
461465
try:
462466
import tables # noqa
463467
except ImportError as ex: # pragma: no cover

pandas/tests/io/test_pytables.py

+5
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,11 @@ def teardown_method(self, method):
146146
@pytest.mark.filterwarnings("ignore:\\nPanel:FutureWarning")
147147
class TestHDFStore(Base):
148148

149+
def test_format_kwarg_in_constructor(self):
150+
# GH 13291
151+
with ensure_clean_path(self.path) as path:
152+
pytest.raises(ValueError, HDFStore, path, format='table')
153+
149154
def test_context(self):
150155
path = create_tempfile(self.path)
151156
try:

0 commit comments

Comments
 (0)