Skip to content

Commit c211119

Browse files
committed
compat for python 3.12
1 parent da6dbc7 commit c211119

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

pandas/tests/groupby/aggregate/test_numba.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,16 @@ def correct_function(values, index, a):
4848
expected = data.groupby("key").sum() * 2.7
4949

5050
# py signature binding
51-
with pytest.raises(TypeError, match="missing a required argument: 'a'"):
51+
with pytest.raises(
52+
TypeError, match="missing a required (keyword-only argument|argument): 'a'"
53+
):
5254
data.groupby("key").agg(incorrect_function, engine="numba", b=1)
5355
with pytest.raises(TypeError, match="missing a required argument: 'a'"):
5456
data.groupby("key").agg(correct_function, engine="numba", b=1)
5557

56-
with pytest.raises(TypeError, match="missing a required argument: 'a'"):
58+
with pytest.raises(
59+
TypeError, match="missing a required (keyword-only argument|argument): 'a'"
60+
):
5761
data.groupby("key")["data"].agg(incorrect_function, engine="numba", b=1)
5862
with pytest.raises(TypeError, match="missing a required argument: 'a'"):
5963
data.groupby("key")["data"].agg(correct_function, engine="numba", b=1)

pandas/tests/groupby/transform/test_numba.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,16 @@ def correct_function(values, index, a):
4444
columns=["key", "data"],
4545
)
4646
# py signature binding
47-
with pytest.raises(TypeError, match="missing a required argument: 'a'"):
47+
with pytest.raises(
48+
TypeError, match="missing a required (keyword-only argument|argument): 'a'"
49+
):
4850
data.groupby("key").transform(incorrect_function, engine="numba", b=1)
4951
with pytest.raises(TypeError, match="missing a required argument: 'a'"):
5052
data.groupby("key").transform(correct_function, engine="numba", b=1)
5153

52-
with pytest.raises(TypeError, match="missing a required argument: 'a'"):
54+
with pytest.raises(
55+
TypeError, match="missing a required (keyword-only argument|argument): 'a'"
56+
):
5357
data.groupby("key")["data"].transform(incorrect_function, engine="numba", b=1)
5458
with pytest.raises(TypeError, match="missing a required argument: 'a'"):
5559
data.groupby("key")["data"].transform(correct_function, engine="numba", b=1)

0 commit comments

Comments
 (0)