Skip to content

Commit

Permalink
add test for 20712
Browse files Browse the repository at this point in the history
  • Loading branch information
nameexhaustion committed Jan 15, 2025
1 parent 7f2a2bf commit 9dc2f2c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions py-polars/tests/unit/operations/test_slice.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,3 +310,14 @@ def test_slice_pushdown_panic_20216() -> None:

assert_frame_equal(q.slice(0, 1).collect(), pl.DataFrame({"A": ["1"]}))
assert_frame_equal(q.collect(), pl.DataFrame({"A": ["1"]}))


def test_sorted_slice_after_function_20712() -> None:
assert_frame_equal(
pl.LazyFrame({"a": 10 * ["A"]})
.with_columns(b=pl.col("a").str.extract("(.*)"))
.sort("b")
.head(2)
.collect(),
pl.DataFrame({"a": ["A", "A"], "b": ["A", "A"]}),
)

0 comments on commit 9dc2f2c

Please sign in to comment.