Skip to content

Commit 3ebeec7

Browse files
committed
cleaned up test
1 parent 0930517 commit 3ebeec7

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

pandas/core/frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11229,7 +11229,7 @@ def _series_round(ser: Series, decimals: int) -> Series:
1122911229
nv.validate_round(args, kwargs)
1123011230
if "object" in self.dtypes.values:
1123111231
raise TypeError(
11232-
"All columns must be numeric dtype, but got object dtype column(s)"
11232+
"All columns must be numeric dtype, but got object dtype column"
1123311233
)
1123411234
if isinstance(decimals, (dict, Series)):
1123511235
if isinstance(decimals, Series) and not decimals.index.is_unique:

pandas/tests/frame/methods/test_round.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,7 @@ def test_round_empty_not_input(self):
202202

203203
def test_round_non_numeric_columns(self):
204204
# GH#61679
205-
df = DataFrame(
206-
{
207-
"a": [1.2234242333234, 323432.3243423, np.nan],
208-
"b": ["a", "b", "c"],
209-
}
210-
)
211-
msg = "All columns must be numeric dtype, but got object dtype column\\(s\\)"
205+
df = DataFrame({"col1": [1.22, 10.32, 3.54], "col2": ["a", "b", "c"]})
206+
msg = "All columns must be numeric dtype, but got object dtype column"
212207
with pytest.raises(TypeError, match=msg):
213208
df.round()

0 commit comments

Comments
 (0)