Skip to content

Commit 91a419a

Browse files
authored
fix(rust, python): don't panic on ignored context (#5958)
1 parent ac3f093 commit 91a419a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import polars as pl
2+
3+
4+
def test_context_ignore_5867() -> None:
5+
outer = pl.DataFrame({"OtherCol": [1, 2, 3, 4]}).lazy()
6+
df = (
7+
pl.DataFrame({"Category": [1, 1, 2, 2], "Counts": [1, 2, 3, 4]})
8+
.lazy()
9+
.with_context(outer)
10+
)
11+
assert (
12+
df.groupby("Category", maintain_order=True)
13+
.agg([(pl.col("Counts")).sum()])
14+
.collect()
15+
.to_dict(False)
16+
) == {"Category": [1, 2], "Counts": [3, 7]}

0 commit comments

Comments
 (0)