@@ -338,7 +338,7 @@ def array_with_unit_to_datetime(
338338 f" unit='{unit}' not valid with non-numerical val='{val}'"
339339 )
340340
341- except (ValueError , OutOfBoundsDatetime, TypeError ) as err:
341+ except (ValueError , TypeError ) as err:
342342 if is_raise:
343343 err.args = (f" {err}, at position {i}" ,)
344344 raise
@@ -435,15 +435,15 @@ cpdef array_to_datetime(
435435 Parameters
436436 ----------
437437 values : ndarray of object
438- date-like objects to convert
438+ date-like objects to convert
439439 errors : str, default 'raise'
440- error behavior when parsing
440+ error behavior when parsing
441441 dayfirst : bool, default False
442- dayfirst parsing behavior when encountering datetime strings
442+ dayfirst parsing behavior when encountering datetime strings
443443 yearfirst : bool, default False
444- yearfirst parsing behavior when encountering datetime strings
444+ yearfirst parsing behavior when encountering datetime strings
445445 utc : bool, default False
446- indicator whether the dates should be UTC
446+ indicator whether the dates should be UTC
447447 creso : NPY_DATETIMEUNIT, default NPY_FR_ns
448448 Set to NPY_FR_GENERIC to infer a resolution.
449449
@@ -464,7 +464,7 @@ cpdef array_to_datetime(
464464 bint is_ignore = errors == " ignore"
465465 bint is_coerce = errors == " coerce"
466466 bint is_same_offsets
467- _TSObject _ts
467+ _TSObject tsobj
468468 float tz_offset
469469 set out_tzoffset_vals = set ()
470470 tzinfo tz, tz_out = None
@@ -550,29 +550,28 @@ cpdef array_to_datetime(
550550 creso = state.creso
551551 continue
552552
553- _ts = convert_str_to_tsobject(
553+ tsobj = convert_str_to_tsobject(
554554 val, None , dayfirst = dayfirst, yearfirst = yearfirst
555555 )
556556
557- if _ts .value == NPY_NAT:
557+ if tsobj .value == NPY_NAT:
558558 # e.g. "NaT" string or empty string, we do not consider
559559 # this as either tzaware or tznaive. See
560560 # test_to_datetime_with_empty_str_utc_false_format_mixed
561561 # We also do not update resolution inference based on this,
562562 # see test_infer_with_nat_int_float_str
563- iresult[i] = _ts .value
563+ iresult[i] = tsobj .value
564564 continue
565565
566- item_reso = _ts .creso
566+ item_reso = tsobj .creso
567567 state.update_creso(item_reso)
568568 if infer_reso:
569569 creso = state.creso
570570
571- _ts.ensure_reso(creso, val)
572-
573- iresult[i] = _ts.value
571+ tsobj.ensure_reso(creso, val)
572+ iresult[i] = tsobj.value
574573
575- tz = _ts .tzinfo
574+ tz = tsobj .tzinfo
576575 if tz is not None :
577576 # dateutil timezone objects cannot be hashed, so
578577 # store the UTC offsets in seconds instead
0 commit comments