-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
CLN: move raising TypeError for interpolate
with object
dtype to Block
#58083
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
CLN: move raising TypeError for interpolate
with object
dtype to Block
#58083
Conversation
pandas/core/internals/blocks.py
Outdated
if self.dtype == _dtype_obj: | ||
# only deal with floats | ||
# bc we already checked that can_hold_na, we don't have int dtype here | ||
# test_interp_basic checks that we make a copy here | ||
return [self.copy(deep=False)] | ||
raise TypeError( | ||
f"{type(self).__name__} cannot interpolate with object dtype." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we dont need to have Block in the exception message. the comments in the line above can be removed. can you add "# GH#53631"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can do something like name = {1: "Series", 2: "DataFrame"}[self.ndim]
to keep the exception message unchanged
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you, I made these changes, ci - green.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
thanks @natmokval |
…Block (pandas-dev#58083) * move raising for interpolate with object dtype from NDFrame to Block * correct msg in test_interpolate_cannot_with_object_dtype * correct the exception message and the comments
xref #57820
moved raising
TypeError
forinterpolate
with object dtype fromNDFrame
toBlock