File tree 1 file changed +3
-9
lines changed
1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -234,6 +234,7 @@ def array_with_unit_to_datetime(
234
234
m = cast_from_unit(None , unit)
235
235
236
236
if is_raise:
237
+
237
238
# try a quick conversion to i8
238
239
# if we have nulls that are not type-compat
239
240
# then need to iterate
@@ -246,17 +247,9 @@ def array_with_unit_to_datetime(
246
247
fvalues = iresult.astype(' f8' ) * m
247
248
need_to_iterate = False
248
249
249
- # GH20445
250
- if values.dtype.kind == " f" :
251
- fresult = values.astype(' f8' , casting = ' same_kind' , copy = False )
252
- # fill by comparing to NPY_NAT constant
253
- mask = fresult == NPY_NAT
254
- fresult[mask] = 0.0
255
- fvalues = fvalues.astype(' f8' ) * m # FIXME: this line segfaults rn
256
- need_to_iterate = False
257
-
258
250
# check the bounds
259
251
if not need_to_iterate:
252
+
260
253
if ((fvalues < Timestamp.min.value).any()
261
254
or (fvalues > Timestamp.max.value).any()):
262
255
raise OutOfBoundsDatetime(f" cannot convert input with unit '{unit}'" )
@@ -424,6 +417,7 @@ cpdef array_to_datetime(
424
417
float offset_seconds, tz_offset
425
418
set out_tzoffset_vals = set ()
426
419
bint string_to_dts_failed
420
+
427
421
# specify error conditions
428
422
assert is_raise or is_ignore or is_coerce
429
423
You can’t perform that action at this time.
0 commit comments