Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
CanglongCl committed Apr 4, 2024
1 parent f198457 commit 96609cc
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions py-polars/tests/unit/operations/test_sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,35 +557,27 @@ def test_top_k() -> None:

with pytest.raises(
ValueError,
match=r"the length of `descending` \(2\) does not match the length of `by` \(1\)"
match=r"the length of `descending` \(2\) does not match the length of `by` \(1\)",
):
df2.select(
pl.all().top_k(2, by="a", descending=[True, False])
)
df2.select(pl.all().top_k(2, by="a", descending=[True, False]))

with pytest.raises(
ValueError,
match=r"the length of `descending` \(2\) does not match the length of `by` \(1\)",
):
df2.select(
pl.all().bottom_k(2, by="a", descending=[True, False])
)
df2.select(pl.all().bottom_k(2, by="a", descending=[True, False]))

with pytest.raises(
ValueError,
match=r"`descending` should be a boolean if no `by` is provided",
):
df2.select(
pl.all().top_k(2, descending=[True, False])
)
df2.select(pl.all().top_k(2, descending=[True, False]))

with pytest.raises(
ValueError,
match=r"`descending` should be a boolean if no `by` is provided",
):
df2.select(
pl.all().bottom_k(2, descending=[True, False])
)
df2.select(pl.all().bottom_k(2, descending=[True, False]))


def test_sorted_flag_unset_by_arithmetic_4937() -> None:
Expand Down

0 comments on commit 96609cc

Please sign in to comment.