Skip to content

Commit 50d99ca

Browse files
authored
Adjust tests in window folder for new string option (#56182)
1 parent f6eee83 commit 50d99ca

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pandas/tests/window/test_api.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ def tests_skip_nuisance(step):
7070
def test_sum_object_str_raises(step):
7171
df = DataFrame({"A": range(5), "B": range(5, 10), "C": "foo"})
7272
r = df.rolling(window=3, step=step)
73-
with pytest.raises(DataError, match="Cannot aggregate non-numeric type: object"):
73+
with pytest.raises(
74+
DataError, match="Cannot aggregate non-numeric type: object|string"
75+
):
7476
# GH#42738, enforced in 2.0
7577
r.sum()
7678

pandas/tests/window/test_groupby.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1181,7 +1181,9 @@ def test_pairwise_methods(self, method, expected_data):
11811181
)
11821182
tm.assert_frame_equal(result, expected)
11831183

1184-
expected = df.groupby("A").apply(lambda x: getattr(x.ewm(com=1.0), method)())
1184+
expected = df.groupby("A")[["B"]].apply(
1185+
lambda x: getattr(x.ewm(com=1.0), method)()
1186+
)
11851187
tm.assert_frame_equal(result, expected)
11861188

11871189
def test_times(self, times_frame):

0 commit comments

Comments
 (0)