From 03eadb56e292b66a2cb842fb68d1fd504094f7cb Mon Sep 17 00:00:00 2001 From: Brock Date: Thu, 19 Jan 2023 09:50:24 -0800 Subject: [PATCH] REF: simplify array_to_datetime --- pandas/_libs/tslib.pyx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/pandas/_libs/tslib.pyx b/pandas/_libs/tslib.pyx index df6204d61f983..8a13e19738f0c 100644 --- a/pandas/_libs/tslib.pyx +++ b/pandas/_libs/tslib.pyx @@ -515,15 +515,9 @@ cpdef array_to_datetime( if val != val or val == NPY_NAT: iresult[i] = NPY_NAT - elif is_raise or is_ignore: - iresult[i] = val else: - # coerce # we now need to parse this as if unit='ns' - try: - iresult[i] = cast_from_unit(val, "ns") - except OverflowError: - iresult[i] = NPY_NAT + iresult[i] = cast_from_unit(val, "ns") elif isinstance(val, str): # string