Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pandas/core/dtypes/cast.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
)
import warnings

from dateutil.parser import ParserError
import numpy as np

from pandas._libs import lib
Expand Down Expand Up @@ -1336,9 +1337,8 @@ def maybe_cast_to_datetime(
value = dta.tz_localize("UTC").tz_convert(dtype.tz)
except OutOfBoundsDatetime:
raise
except ValueError:
# TODO(GH#40048): only catch dateutil's ParserError
# once we can reliably import it in all supported versions
except ParserError:
# Note: this is dateutil's ParserError, not ours.
pass

elif getattr(vdtype, "kind", None) in ["m", "M"]:
Expand Down