Skip to content
Merged
Changes from 1 commit
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/_libs/tslib.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ cpdef array_to_datetime(
continue
elif is_raise:
raise ValueError(
f"time data {val} doesn't match format specified"
f"time data \"{val}\" at position {i} doesn't match format specified"
)
return values, tz_out

Expand All @@ -607,11 +607,11 @@ cpdef array_to_datetime(
# to check if all arguments have the same tzinfo
tz = py_dt.utcoffset()

except (ValueError, OverflowError):
except (ValueError, OverflowError) as err:
if is_coerce:
iresult[i] = NPY_NAT
continue
raise TypeError("invalid string coercion to datetime")
raise type(err)(f"invalid string coercion to datetime for \"{val}\" at position {i}")

if tz is not None:
seen_datetime_offset = True
Expand Down