Skip to content

Commit

Permalink
fix(rust, python): don't panic on ignored context (#5958)
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Dec 30, 2022
1 parent ac3f093 commit 91a419a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions py-polars/tests/unit/test_context.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import polars as pl


def test_context_ignore_5867() -> None:
outer = pl.DataFrame({"OtherCol": [1, 2, 3, 4]}).lazy()
df = (
pl.DataFrame({"Category": [1, 1, 2, 2], "Counts": [1, 2, 3, 4]})
.lazy()
.with_context(outer)
)
assert (
df.groupby("Category", maintain_order=True)
.agg([(pl.col("Counts")).sum()])
.collect()
.to_dict(False)
) == {"Category": [1, 2], "Counts": [3, 7]}

0 comments on commit 91a419a

Please sign in to comment.