8000 BUG: round on object columns no longer raises a TypeError by KevsterAmp · Pull Request #61399 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

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

Merged
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
Prev Previous commit
Next Next commit
add test
  • Loading branch information
KevsterAmp committed May 20, 2025
commit 428ba133298c0853b40e102e370a209bc393e586
7 changes: 7 additions & 0 deletions pandas/tests/series/methods/test_round.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,10 @@ 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")
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

msg = "Expected numeric dtype, got object instead."
with pytest.raises(TypeError, match=msg):
ser.round()

0