@@ -1211,7 +1211,7 @@ def test_out_of_bounds_errors_ignore2(self):
1211
1211
msg = "errors='ignore' is deprecated"
1212
1212
with tm .assert_produces_warning (FutureWarning , match = msg ):
1213
1213
res = to_datetime (Series (["2362-01-01" , np .nan ]), errors = "ignore" )
1214
- exp = Series (["2362-01-01" , np .nan ], dtype = object )
1214
+ exp = Series (["2362-01-01" , np .nan ], dtype = "M8[s]" )
1215
1215
tm .assert_series_equal (res , exp )
1216
1216
1217
1217
def test_to_datetime_tz (self , cache ):
@@ -2955,11 +2955,7 @@ def test_infer_datetime_format_tz_name(self, tz_name, offset):
2955
2955
result = to_datetime (ser )
2956
2956
tz = timezone (timedelta (minutes = offset ))
2957
2957
expected = Series ([Timestamp ("2019-02-02 08:07:13" ).tz_localize (tz )])
2958
- # TODO: not great that we get different units here
2959
- if offset == 0 :
2960
- expected = expected .dt .as_unit ("s" )
2961
- else :
2962
- expected = expected .dt .as_unit ("us" )
2958
+ expected = expected .dt .as_unit ("s" )
2963
2959
tm .assert_series_equal (result , expected )
2964
2960
2965
2961
@pytest .mark .parametrize (
@@ -3141,11 +3137,6 @@ def test_parsers(self, date_str, expected, cache):
3141
3137
date_str , yearfirst = yearfirst
3142
3138
)
3143
3139
3144
- # FIXME: in these cases reso_attrname is coming back as "microsecond"
3145
- # instead of "second". The array_strptime paths get these right, but
3146
- # the DatetimeIndex (array_to_datetime) and Timestamp constructors do not.
3147
- is_broken = date_str in ["2005/11/09 10:15:32 AM" , "Thu Sep 25 10:36:28 2003" ]
3148
-
3149
3140
reso = {
3150
3141
"nanosecond" : "ns" ,
3151
3142
"microsecond" : "us" ,
@@ -3168,18 +3159,13 @@ def test_parsers(self, date_str, expected, cache):
3168
3159
for res in [result3 , result4 ]:
3169
3160
exp = DatetimeIndex ([Timestamp (expected )])
3170
3161
exp = exp .as_unit (reso )
3171
- if is_broken :
3172
- exp = exp .as_unit ("s" )
3173
3162
tm .assert_index_equal (res , exp )
3174
3163
3175
3164
for res in [result6 , result8 , result9 ]:
3176
3165
# These cases go through array_to_datetime, not array_to_strptime.
3177
3166
# This means that as of GH#??? they do resolution inference
3178
3167
# while the other cases do not.
3179
3168
exp = DatetimeIndex ([Timestamp (expected )]).as_unit (reso )
3180
- if is_broken :
3181
- # FIXME: should be "s"
3182
- exp = exp .as_unit ("us" )
3183
3169
tm .assert_index_equal (res , exp )
3184
3170
3185
3171
# these really need to have yearfirst, but we don't support
0 commit comments