File tree 1 file changed +3
-13
lines changed
1 file changed +3
-13
lines changed Original file line number Diff line number Diff line change 26
26
)
27
27
import warnings
28
28
29
- from dateutil .parser import ParserError
30
29
import numpy as np
31
30
32
31
from pandas ._libs import (
@@ -1588,19 +1587,10 @@ def maybe_cast_to_datetime(
1588
1587
value = to_timedelta (value , errors = "raise" )._values
1589
1588
except OutOfBoundsDatetime :
1590
1589
raise
1591
- except ParserError :
1592
- # Note: ParserError subclasses ValueError
1593
- # str that we can't parse to datetime
1590
+ except ValueError :
1591
+ # TODO(GH#40048): only catch dateutil's ParserError
1592
+ # once we can reliably import it in all supported versions
1594
1593
pass
1595
- except ValueError as err :
1596
- if "mixed datetimes and integers in passed array" in str (err ):
1597
- # array_to_datetime does not allow this;
1598
- # when called from _try_cast, this will be followed
1599
- # by a call to construct_1d_ndarray_preserving_na
1600
- # which will convert these
1601
- pass
1602
- else :
1603
- raise
1604
1594
1605
1595
# coerce datetimelike to object
1606
1596
elif is_datetime64_dtype (
You can’t perform that action at this time.
0 commit comments