Skip to content

Commit 2c68a02

Browse files
committed
BUG: Do not allow format keyword in HDFStore
Closes: pandas-dev#13291
1 parent af4ed0f commit 2c68a02

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

pandas/io/pytables.py

+3
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,9 @@ def __init__(self, path, mode=None, complevel=None, complib=None,
401401
raise ValueError("complib only supports 'blosc', 'bzip2', lzo' "
402402
"or 'zlib' compression.")
403403

404+
if 'format' in kwargs.keys():
405+
raise TypeError("format is not a supported keyword for HDFStore")
406+
404407
self._path = path
405408
if mode is None:
406409
mode = 'a'

pandas/io/tests/test_pytables.py

+5
Original file line numberDiff line numberDiff line change
@@ -4920,6 +4920,11 @@ def test_read_from_py_localpath(self):
49204920

49214921
tm.assert_frame_equal(expected, actual)
49224922

4923+
def test_format_arg_in_constructor(self):
4924+
4925+
# GH13291
4926+
with ensure_clean_path(self.path) as filename:
4927+
self.assertRaises(TypeError, HDFStore, filename, format='table')
49234928

49244929
class TestHDFComplexValues(Base):
49254930
# GH10447

0 commit comments

Comments
 (0)