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 @@ -234,6 +234,7 @@ def array_with_unit_to_datetime(
234234 m = cast_from_unit(None , unit)
235235
236236 if is_raise:
237+
237238 # try a quick conversion to i8
238239 # if we have nulls that are not type-compat
239240 # then need to iterate
@@ -246,17 +247,9 @@ def array_with_unit_to_datetime(
246247 fvalues = iresult.astype(' f8' ) * m
247248 need_to_iterate = False
248249
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-
258250 # check the bounds
259251 if not need_to_iterate:
252+
260253 if ((fvalues < Timestamp.min.value).any()
261254 or (fvalues > Timestamp.max.value).any()):
262255 raise OutOfBoundsDatetime(f" cannot convert input with unit '{unit}'" )
@@ -424,6 +417,7 @@ cpdef array_to_datetime(
424417 float offset_seconds, tz_offset
425418 set out_tzoffset_vals = set ()
426419 bint string_to_dts_failed
420+
427421 # specify error conditions
428422 assert is_raise or is_ignore or is_coerce
429423
You can’t perform that action at this time.
0 commit comments