Skip to content

Commit 06db464

Browse files
TST: Added test for consistent type with unique agg pandas-dev#22558
1 parent 1d695b1 commit 06db464

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
@@ -1438,3 +1438,15 @@ def test_agg_of_mode_list(test, constant):
14381438
expected = expected.set_index(0)
14391439

14401440
tm.assert_frame_equal(result, expected)
1441+
1442+
1443+
def test_unique_agg_type():
1444+
# GH#22558
1445+
df1 = DataFrame({"a": [1, 2, 3], "b": [1, 1, 1]})
1446+
df2 = DataFrame({"a": [2, 2, 2], "b": [1, 1, 1]})
1447+
aggregation = {"a": "unique", "b": "unique"}
1448+
1449+
agg1 = df1.agg(aggregation)
1450+
agg2 = df2.agg(aggregation)
1451+
1452+
tm.assert_class_equal(agg1, agg2)

0 commit comments

Comments
 (0)