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
4 changes: 1 addition & 3 deletions pandas/core/arrays/timedeltas.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@
from pandas.tseries.frequencies import to_offset
from pandas.tseries.offsets import Tick

_BAD_DTYPE = "dtype {dtype} cannot be converted to timedelta64[ns]"


def _is_convertible_to_td(key):
return isinstance(key, (Tick, timedelta, np.timedelta64, str))
Expand Down Expand Up @@ -1064,7 +1062,7 @@ def _validate_td64_dtype(dtype):
raise ValueError(msg)

if not is_dtype_equal(dtype, _TD_DTYPE):
raise ValueError(_BAD_DTYPE.format(dtype=dtype))
raise ValueError(f"dtype {dtype} cannot be converted to timedelta64[ns]")

return dtype

Expand Down