| 83 | |
| 84 | |
| 85 | def test_default_mode(temp_h5_path, using_infer_string): |
| 86 | # read_hdf uses default mode |
| 87 | df = DataFrame( |
| 88 | np.random.default_rng(2).standard_normal((10, 4)), |
| 89 | columns=Index(list("ABCD"), dtype=object), |
| 90 | index=date_range("2000-01-01", periods=10, freq="B"), |
| 91 | ) |
| 92 | df.to_hdf(temp_h5_path, key="df", mode="w") |
| 93 | result = read_hdf(temp_h5_path, "df") |
| 94 | expected = df.copy() |
| 95 | if using_infer_string: |
| 96 | expected.columns = expected.columns.astype("str") |
| 97 | tm.assert_frame_equal(result, expected) |
| 98 | |
| 99 | |
| 100 | def test_reopen_handle(temp_h5_path): |