Skip to content

Commit 9679339

Browse files
committed
BUG-46369: add test
1 parent f3b8439 commit 9679339

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pandas/tests/groupby/test_apply.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,3 +1317,15 @@ def test_apply_str_with_args(df, args, kwargs):
13171317
result = gb.apply("sum", *args, **kwargs)
13181318
expected = gb.sum(numeric_only=True)
13191319
tm.assert_frame_equal(result, expected)
1320+
1321+
1322+
def test_result_name_when_one_group():
1323+
# GH 46369
1324+
names = ("some_name", None)
1325+
1326+
for name in names:
1327+
ser = Series([0, 1], name=name)
1328+
result = ser.groupby(["a", "a"]).apply(lambda x: x).name
1329+
expected = name
1330+
1331+
assert result == expected

0 commit comments

Comments
 (0)