Skip to content

Commit

Permalink
exception coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
FBruzzesi committed Oct 7, 2024
1 parent 4aca3f2 commit a202252
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion narwhals/expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -4222,7 +4222,7 @@ def max_horizontal(*exprs: IntoExpr | Iterable[IntoExpr]) -> Expr:
a: [[4,8,3]]
"""
if not exprs:
msg = "At least one expression must be passed to `sum_horizontal`"
msg = "At least one expression must be passed to `max_horizontal`"
raise ValueError(msg)
return Expr(
lambda plx: plx.max_horizontal(
Expand Down
10 changes: 10 additions & 0 deletions tests/expr_and_series/all_horizontal_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,13 @@ def test_horizontal_expressions_emtpy(constructor: Constructor) -> None:
ValueError, match=r"At least one expression must be passed.*sum_horizontal"
):
df.select(nw.sum_horizontal())

with pytest.raises(
ValueError, match=r"At least one expression must be passed.*max_horizontal"
):
df.select(nw.max_horizontal())

with pytest.raises(
ValueError, match=r"At least one expression must be passed.*min_horizontal"
):
df.select(nw.min_horizontal())

0 comments on commit a202252

Please sign in to comment.