-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: round on object columns no longer raises a TypeError #61399
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
base: 2.3.x
Are you sure you want to change the base?
BUG: round on object columns no longer raises a TypeError #61399
Conversation
|
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.
Looking good - can you add a note in the 2.3 whatsnew. I think we should backport this as it's a regression.
cc @mroeschke
@@ -72,3 +72,9 @@ def test_round_ea_boolean(self): | |||
tm.assert_series_equal(result, expected) | |||
result.iloc[0] = False | |||
tm.assert_series_equal(ser, expected) | |||
|
|||
def test_round_dtype_object(self): | |||
ser = Series([0.2], dtype="object") |
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 you add a reference to the GitHub issue
@@ -2814,6 +2814,8 @@ def round(self, decimals: int = 0, *args, **kwargs) -> Series: | |||
dtype: float64 | |||
""" | |||
nv.validate_round(args, kwargs) | |||
if self._mgr.dtype == "object": |
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.
if self._mgr.dtype == "object": | |
if self.dtype == "object": |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.