From f198457ed95db5e5fc2f3ffd4643ebfe62239c97 Mon Sep 17 00:00:00 2001 From: Lava <34743145+CanglongCl@users.noreply.github.com> Date: Thu, 4 Apr 2024 01:03:38 -0700 Subject: [PATCH] Add test case for bottom_k() descending=True with no by --- py-polars/tests/unit/operations/test_sort.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/py-polars/tests/unit/operations/test_sort.py b/py-polars/tests/unit/operations/test_sort.py index 8c9a1cbc4de6a..842139d3e1318 100644 --- a/py-polars/tests/unit/operations/test_sort.py +++ b/py-polars/tests/unit/operations/test_sort.py @@ -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()),