Skip to content

Commit 63a02d7

Browse files
committed
add test case for pandas-dev#50105
1 parent 7c0278e commit 63a02d7

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

pandas/tests/io/pytables/test_round_trip.py

+21
Original file line numberDiff line numberDiff line change
@@ -553,3 +553,24 @@ def test_round_trip_equals(tmp_path, setup_path):
553553
tm.assert_frame_equal(df, other)
554554
assert df.equals(other)
555555
assert other.equals(df)
556+
557+
558+
def test_many_dataframes_get_storer(tmp_path, setup_path):
559+
items = [
560+
({"x": {1.0: "a"}, "y": {1.0: 1}}, "/data00"),
561+
({"x": {2.0: "b"}, "y": {2.0: 2}}, "/data01"),
562+
({"x": {4.0: "d"}, "y": {4.0: 4}}, "/data03"),
563+
({"x": {6.0: "f"}, "y": {6.0: 6}}, "/data05"),
564+
({"x": {5.0: "e"}, "y": {5.0: 5}}, "/data04"),
565+
({"x": {11.0: "k"}, "y": {11.0: 11}}, "/data10"),
566+
({"x": {7.0: "g"}, "y": {7.0: 7}}, "/data06"),
567+
({"x": {8.0: "h"}, "y": {8.0: 8}}, "/data07"),
568+
({"x": {9.0: "i"}, "y": {9.0: 9}}, "/data08"),
569+
]
570+
571+
fn = tmp_path / setup_path
572+
for df, key in items2:
573+
pd.DataFrame(df).to_hdf(fn, key, format="table", mode="a", append=False)
574+
with pd.HDFStore(fn, mode="r") as hdf:
575+
for k in hdf.keys():
576+
hdf.get_storer(k)

0 commit comments

Comments
 (0)