@@ -200,15 +200,24 @@ def test_put_compression_blosc(setup_path):
200200 tm .assert_frame_equal (result , expected )
201201
202202
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+
203213def test_put_mixed_type (setup_path , performance_warning , using_infer_string ):
204214 df = DataFrame (
205215 np .random .default_rng (2 ).standard_normal ((10 , 4 )),
206216 columns = Index (list ("ABCD" )),
207217 index = date_range ("2000-01-01" , periods = 10 , freq = "B" ),
208218 )
209219 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" )
212221 df ["bool1" ] = df ["A" ] > 0
213222 df ["bool2" ] = df ["B" ] > 0
214223 df ["bool3" ] = True
@@ -274,6 +283,7 @@ def test_column_multiindex(setup_path, using_infer_string):
274283
275284 with ensure_clean_store (setup_path ) as store :
276285 if using_infer_string :
286+ # TODO(infer_string) make this work for string dtype
277287 msg = "Saving a MultiIndex with an extension dtype is not supported."
278288 with pytest .raises (NotImplementedError , match = msg ):
279289 store .put ("df" , df )
0 commit comments