Skip to content

Commit f69efb6

Browse files
authored
REF: simplify array_to_datetime (#50869)
1 parent da2b086 commit f69efb6

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

pandas/_libs/tslib.pyx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -497,15 +497,9 @@ cpdef array_to_datetime(
497497

498498
if val != val or val == NPY_NAT:
499499
iresult[i] = NPY_NAT
500-
elif is_raise or is_ignore:
501-
iresult[i] = val
502500
else:
503-
# coerce
504501
# we now need to parse this as if unit='ns'
505-
try:
506-
iresult[i] = cast_from_unit(val, "ns")
507-
except OverflowError:
508-
iresult[i] = NPY_NAT
502+
iresult[i] = cast_from_unit(val, "ns")
509503

510504
elif isinstance(val, str):
511505
# string

0 commit comments

Comments
 (0)