Skip to content

CLN: F-strings #30916

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 11, 2020
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