Skip to content

Commit 0097f75

Browse files
TST: Added test for consistent type with unique agg pandas-dev#22558
1 parent 8ce4f29 commit 0097f75

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pandas/tests/groupby/aggregate/test_aggregate.py

+12
Original file line numberDiff line numberDiff line change
@@ -1413,3 +1413,15 @@ def test_multi_axis_1_raises(func):
14131413
gb = df.groupby("a", axis=1)
14141414
with pytest.raises(NotImplementedError, match="axis other than 0 is not supported"):
14151415
gb.agg(func)
1416+
1417+
1418+
def test_unique_agg_type():
1419+
# GH#22558
1420+
df1 = DataFrame({"a": [1, 2, 3], "b": [1, 1, 1]})
1421+
df2 = DataFrame({"a": [2, 2, 2], "b": [1, 1, 1]})
1422+
aggregation = {"a": "unique", "b": "unique"}
1423+
1424+
agg1 = df1.agg(aggregation)
1425+
agg2 = df2.agg(aggregation)
1426+
1427+
tm.assert_class_equal(agg1, agg2)

0 commit comments

Comments
 (0)