We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 399962c commit 59ba159Copy full SHA for 59ba159
pandas/core/dtypes/cast.py
@@ -20,6 +20,7 @@
20
)
21
import warnings
22
23
+from dateutil.parser import ParserError
24
import numpy as np
25
26
from pandas._libs import lib
@@ -1336,9 +1337,8 @@ def maybe_cast_to_datetime(
1336
1337
value = dta.tz_localize("UTC").tz_convert(dtype.tz)
1338
except OutOfBoundsDatetime:
1339
raise
- except ValueError:
1340
- # TODO(GH#40048): only catch dateutil's ParserError
1341
- # once we can reliably import it in all supported versions
+ except ParserError:
+ # Note: this is dateutil's ParserError, not ours.
1342
pass
1343
1344
elif getattr(vdtype, "kind", None) in ["m", "M"]:
0 commit comments