@@ -154,7 +154,7 @@ def test_pytables_native_read(datapath):
154
154
datapath ("io" , "data" , "legacy_hdf/pytables_native.h5" ), mode = "r"
155
155
) as store :
156
156
d2 = store ["detector/readout" ]
157
- assert isinstance (d2 , DataFrame )
157
+ assert isinstance (d2 , DataFrame )
158
158
159
159
160
160
@pytest .mark .skipif (is_platform_windows (), reason = "native2 read fails oddly on windows" )
@@ -164,7 +164,7 @@ def test_pytables_native2_read(datapath):
164
164
) as store :
165
165
str (store )
166
166
d1 = store ["detector" ]
167
- assert isinstance (d1 , DataFrame )
167
+ assert isinstance (d1 , DataFrame )
168
168
169
169
170
170
def test_legacy_table_fixed_format_read_py2 (datapath ):
@@ -174,28 +174,29 @@ def test_legacy_table_fixed_format_read_py2(datapath):
174
174
datapath ("io" , "data" , "legacy_hdf" , "legacy_table_fixed_py2.h5" ), mode = "r"
175
175
) as store :
176
176
result = store .select ("df" )
177
- expected = DataFrame (
178
- [[1 , 2 , 3 , "D" ]],
179
- columns = ["A" , "B" , "C" , "D" ],
180
- index = Index (["ABC" ], name = "INDEX_NAME" ),
181
- )
182
- tm .assert_frame_equal (expected , result )
177
+ expected = DataFrame (
178
+ [[1 , 2 , 3 , "D" ]],
179
+ columns = ["A" , "B" , "C" , "D" ],
180
+ index = Index (["ABC" ], name = "INDEX_NAME" ),
181
+ )
182
+ tm .assert_frame_equal (expected , result )
183
183
184
184
185
185
def test_legacy_table_fixed_format_read_datetime_py2 (datapath ):
186
186
# GH 31750
187
187
# legacy table with fixed format and datetime64 column written in Python 2
188
+ expected = DataFrame (
189
+ [[Timestamp ("2020-02-06T18:00" )]],
190
+ columns = ["A" ],
191
+ index = Index (["date" ]),
192
+ dtype = "M8[ns]" ,
193
+ )
188
194
with ensure_clean_store (
189
195
datapath ("io" , "data" , "legacy_hdf" , "legacy_table_fixed_datetime_py2.h5" ),
190
196
mode = "r" ,
191
197
) as store :
192
198
result = store .select ("df" )
193
- expected = DataFrame (
194
- [[Timestamp ("2020-02-06T18:00" )]],
195
- columns = ["A" ],
196
- index = Index (["date" ]),
197
- )
198
- tm .assert_frame_equal (expected , result )
199
+ tm .assert_frame_equal (expected , result )
199
200
200
201
201
202
def test_legacy_table_read_py2 (datapath ):
@@ -264,7 +265,7 @@ def test_read_hdf_iterator(tmp_path, setup_path):
264
265
with closing (iterator .store ):
265
266
assert isinstance (iterator , TableIterator )
266
267
indirect = next (iterator .__iter__ ())
267
- tm .assert_frame_equal (direct , indirect )
268
+ tm .assert_frame_equal (direct , indirect )
268
269
269
270
270
271
def test_read_nokey (tmp_path , setup_path ):
@@ -387,7 +388,7 @@ def test_read_py2_hdf_file_in_py3(datapath):
387
388
mode = "r" ,
388
389
) as store :
389
390
result = store ["p" ]
390
- tm .assert_frame_equal (result , expected )
391
+ tm .assert_frame_equal (result , expected )
391
392
392
393
393
394
def test_read_infer_string (tmp_path , setup_path ):
0 commit comments