@@ -200,15 +200,24 @@ def test_put_compression_blosc(setup_path):
200
200
tm .assert_frame_equal (result , expected )
201
201
202
202
203
+ def test_put_datetime_ser (setup_path , performance_warning , using_infer_string ):
204
+ # https://github.com/pandas-dev/pandas/pull/60625
205
+ ser = Series (3 * [Timestamp ("20010102" ).as_unit ("ns" )])
206
+ with ensure_clean_store (setup_path ) as store :
207
+ store .put ("ser" , ser )
208
+ expected = ser .copy ()
209
+ result = store .get ("ser" )
210
+ tm .assert_frame_equal (result , expected )
211
+
212
+
203
213
def test_put_mixed_type (setup_path , performance_warning , using_infer_string ):
204
214
df = DataFrame (
205
215
np .random .default_rng (2 ).standard_normal ((10 , 4 )),
206
216
columns = Index (list ("ABCD" )),
207
217
index = date_range ("2000-01-01" , periods = 10 , freq = "B" ),
208
218
)
209
219
df ["obj1" ] = "foo"
210
- df ["obj2" ] = [pd .NA ] + 9 * ["bar" ]
211
- df ["obj2" ] = df ["obj2" ].astype ("string" )
220
+ df ["obj2" ] = pd .array ([pd .NA ] + 9 * ["bar" ], dtype = "string" )
212
221
df ["bool1" ] = df ["A" ] > 0
213
222
df ["bool2" ] = df ["B" ] > 0
214
223
df ["bool3" ] = True
@@ -274,6 +283,7 @@ def test_column_multiindex(setup_path, using_infer_string):
274
283
275
284
with ensure_clean_store (setup_path ) as store :
276
285
if using_infer_string :
286
+ # TODO(infer_string) make this work for string dtype
277
287
msg = "Saving a MultiIndex with an extension dtype is not supported."
278
288
with pytest .raises (NotImplementedError , match = msg ):
279
289
store .put ("df" , df )
0 commit comments