Skip to content

Commit

Permalink
Add test case for bottom_k() descending=True with no by
Browse files Browse the repository at this point in the history
  • Loading branch information
CanglongCl committed Apr 4, 2024
1 parent 4b4ce71 commit f198457
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions py-polars/tests/unit/operations/test_sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,11 @@ def test_top_k() -> None:
pl.DataFrame({"test": [1, 2, 3, 4]}),
)

assert_frame_equal(
df.select(pl.col("test").bottom_k(10, descending=True)),
pl.DataFrame({"test": [4, 3, 2, 1]}),
)

assert_frame_equal(
df.select(
top_k=pl.col("test").top_k(pl.col("val").min()),
Expand Down

0 comments on commit f198457

Please sign in to comment.