Skip to content

Commit

Permalink
test: toggle coverage for dask group_by (#732)
Browse files Browse the repository at this point in the history
  • Loading branch information
aidoskanapyanov authored Aug 7, 2024
1 parent 16ca944 commit 463b328
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 1 addition & 2 deletions narwhals/_dask/group_by.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ def agg(
)
output_names: list[str] = copy(self._keys)
for expr in exprs:
# TODO(unassigned): Need to implement `.all()` for Dask first, part of GH 637
if expr._output_names is None: # pragma: no cover
if expr._output_names is None:
msg = (
"Anonymous expressions are not supported in group_by.agg.\n"
"Instead of `nw.all()`, try using a named expression, such as "
Expand Down
5 changes: 5 additions & 0 deletions tests/test_group_by.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ def test_invalid_group_by_dask() -> None:
with pytest.raises(RuntimeError, match="does your"):
nw.from_native(df_dask).group_by("a").agg(nw.col("b"))

with pytest.raises(
ValueError, match=r"Anonymous expressions are not supported in group_by\.agg"
):
nw.from_native(df_dask).group_by("a").agg(nw.all().mean())


def test_invalid_group_by() -> None:
df = nw.from_native(df_pandas)
Expand Down

0 comments on commit 463b328

Please sign in to comment.