Skip to content

Commit 0c7d071

Browse files
committed
extra test
1 parent 250f949 commit 0c7d071

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/test_group_by.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,14 @@ def test_group_by_n_unique_w_missing(constructor: Any) -> None:
136136
compare_dicts(result, expected)
137137

138138

139+
def test_group_by_same_name_twice() -> None:
140+
import pandas as pd
141+
142+
df = pd.DataFrame({"a": [1, 1, 2], "b": [4, 5, 6]})
143+
with pytest.raises(ValueError, match="two aggregations with the same"):
144+
nw.from_native(df).group_by("a").agg(nw.col("b").sum(), nw.col("b").n_unique())
145+
146+
139147
def test_group_by_empty_result_pandas() -> None:
140148
df_any = pd.DataFrame({"a": [1, 2, 3], "b": [4, 3, 2]})
141149
df = nw.from_native(df_any, eager_only=True)

0 commit comments

Comments
 (0)