File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -652,7 +652,7 @@ cpdef array_to_datetime(
652
652
else :
653
653
raise TypeError (f" {type(val)} is not convertible to datetime" )
654
654
655
- except OutOfBoundsDatetime:
655
+ except OutOfBoundsDatetime as ex :
656
656
if is_coerce:
657
657
iresult[i] = NPY_NAT
658
658
continue
@@ -664,11 +664,11 @@ cpdef array_to_datetime(
664
664
665
665
# Still raise OutOfBoundsDatetime,
666
666
# as error message is informative.
667
- raise OutOfBoundsDatetime(f" Cannot convert \" {val}\" at position {i} to datetime" )
667
+ raise OutOfBoundsDatetime(f" Cannot convert \" {val}\" at position {i} to datetime" ) from ex
668
668
669
669
assert is_ignore
670
670
return values, tz_out
671
- raise OutOfBoundsDatetime(f" Cannot convert \" {val}\" at position {i} to datetime" )
671
+ raise OutOfBoundsDatetime(f" Cannot convert \" {val}\" at position {i} to datetime" ) from ex
672
672
673
673
except OutOfBoundsDatetime:
674
674
if is_raise:
You can’t perform that action at this time.
0 commit comments