Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Nov 11, 2024
1 parent 134e249 commit 5d83109
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions py-polars/tests/unit/operations/test_top_k.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,21 +409,21 @@ def test_top_k_df() -> None:
assert df.bottom_k(3, by="a").collect()["a"].to_list() == expected

df = pl.LazyFrame({"a": [1, None, None, 4, 5]})
expected = [5, 4, 1, None]
expected2 = [5, 4, 1, None]
assert (
df.sort("a", descending=True, nulls_last=True).limit(4).collect()["a"].to_list()
== expected
)
assert df.top_k(4, by="a").collect()["a"].to_list() == expected
expected = [1, 4, 5, None]
assert df.top_k(4, by="a").collect()["a"].to_list() == expected2
expected2 = [1, 4, 5, None]
assert (
df.sort("a", descending=False, nulls_last=True)
.limit(4)
.collect()["a"]
.to_list()
== expected
== expected2
)
assert df.bottom_k(4, by="a").collect()["a"].to_list() == expected
assert df.bottom_k(4, by="a").collect()["a"].to_list() == expected2

assert df.sort("a", descending=False, nulls_last=False).limit(4).collect()[
"a"
Expand Down

0 comments on commit 5d83109

Please sign in to comment.