File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -227,6 +227,7 @@ def array_with_unit_to_datetime(
227
227
m = cast_from_unit(None , unit)
228
228
229
229
if is_raise:
230
+
230
231
# try a quick conversion to i8
231
232
# if we have nulls that are not type-compat
232
233
# then need to iterate
@@ -239,17 +240,9 @@ def array_with_unit_to_datetime(
239
240
fvalues = iresult.astype(' f8' ) * m
240
241
need_to_iterate = False
241
242
242
- # GH20445
243
- if values.dtype.kind == " f" :
244
- fresult = values.astype(' f8' , casting = ' same_kind' , copy = False )
245
- # fill by comparing to NPY_NAT constant
246
- mask = fresult == NPY_NAT
247
- fresult[mask] = 0.0
248
- fvalues = fvalues.astype(' f8' ) * m # FIXME: this line segfaults rn
249
- need_to_iterate = False
250
-
251
243
# check the bounds
252
244
if not need_to_iterate:
245
+
253
246
if ((fvalues < Timestamp.min.value).any()
254
247
or (fvalues > Timestamp.max.value).any()):
255
248
raise OutOfBoundsDatetime(f" cannot convert input with unit '{unit}'" )
@@ -417,6 +410,7 @@ cpdef array_to_datetime(
417
410
float offset_seconds, tz_offset
418
411
set out_tzoffset_vals = set ()
419
412
bint string_to_dts_failed
413
+
420
414
# specify error conditions
421
415
assert is_raise or is_ignore or is_coerce
422
416
You can’t perform that action at this time.
0 commit comments