Skip to content

Commit ee93b34

Browse files
committed
Added test to reproduce issue pandas-dev#16583
1 parent bf99975 commit ee93b34

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pandas/tests/io/test_pytables.py

+10
Original file line numberDiff line numberDiff line change
@@ -5191,6 +5191,16 @@ def test_query_compare_column_type(self):
51915191
expected = df.loc[[], :]
51925192
tm.assert_frame_equal(expected, result)
51935193

5194+
def test_read_hdf_series_fixed(self):
5195+
# GH 16583
5196+
# Tests that reading a Series saved to an HDF file in 'fixed' format
5197+
# still works if a mode='r' argument is supplied
5198+
series = tm.makeFloatSeries()
5199+
with ensure_clean_path(self.path) as path:
5200+
series.to_hdf(path, key='data', format='fixed')
5201+
result = pd.read_hdf(path, key='data', mode='r')
5202+
tm.assert_series_equal(result, series)
5203+
51945204
@pytest.mark.skipif(sys.version_info < (3, 6), reason="Need python 3.6")
51955205
def test_fspath(self):
51965206
with tm.ensure_clean('foo.h5') as path:

0 commit comments

Comments
 (0)