@@ -891,14 +891,13 @@ def test_big_dates(self, datapath):
891
891
expected [5 ][5 ] = expected [5 ][6 ] = datetime (1678 , 1 , 1 )
892
892
893
893
expected = DataFrame (expected , columns = columns , dtype = object )
894
- # FIXME(GH#55564): can't astype directly to ms or s
895
- expected ["date_tc" ] = expected ["date_tc" ].astype ("Period[ms]" ).view ("M8[ms]" )
896
- expected ["date_td" ] = expected ["date_td" ].astype ("Period[s]" ).view ("M8[s]" )
897
- expected ["date_tm" ] = expected ["date_tm" ].astype ("Period[s]" ).view ("M8[s]" )
898
- expected ["date_tw" ] = expected ["date_tw" ].astype ("Period[s]" ).view ("M8[s]" )
899
- expected ["date_tq" ] = expected ["date_tq" ].astype ("Period[s]" ).view ("M8[s]" )
900
- expected ["date_th" ] = expected ["date_th" ].astype ("Period[s]" ).view ("M8[s]" )
901
- expected ["date_ty" ] = expected ["date_ty" ].astype ("Period[s]" ).view ("M8[s]" )
894
+ expected ["date_tc" ] = expected ["date_tc" ].astype ("M8[ms]" )
895
+ expected ["date_td" ] = expected ["date_td" ].astype ("M8[s]" )
896
+ expected ["date_tm" ] = expected ["date_tm" ].astype ("M8[s]" )
897
+ expected ["date_tw" ] = expected ["date_tw" ].astype ("M8[s]" )
898
+ expected ["date_tq" ] = expected ["date_tq" ].astype ("M8[s]" )
899
+ expected ["date_th" ] = expected ["date_th" ].astype ("M8[s]" )
900
+ expected ["date_ty" ] = expected ["date_ty" ].astype ("M8[s]" )
902
901
903
902
parsed_115 = read_stata (datapath ("io" , "data" , "stata" , "stata9_115.dta" ))
904
903
parsed_117 = read_stata (datapath ("io" , "data" , "stata" , "stata9_117.dta" ))
@@ -925,9 +924,7 @@ def test_dtype_conversion(self, datapath):
925
924
expected ["long_" ] = expected ["long_" ].astype (np .int32 )
926
925
expected ["float_" ] = expected ["float_" ].astype (np .float32 )
927
926
expected ["double_" ] = expected ["double_" ].astype (np .float64 )
928
- # FIXME(GH#55564): can't astype directly to M8[ms] without OutOfBoundsDatetime
929
- parr = expected ["date_td" ].astype ("Period[D]" )._values
930
- expected ["date_td" ] = parr .view ("M8[D]" ).astype ("M8[s]" )
927
+ expected ["date_td" ] = expected ["date_td" ].astype ("M8[s]" )
931
928
932
929
no_conversion = read_stata (
933
930
datapath ("io" , "data" , "stata" , "stata6_117.dta" ), convert_dates = True
0 commit comments