[X] I have checked that this issue has not already been reported.
[X] I have confirmed this bug exists on the latest version of Polars.
Reproducible example
import polars as pl
df = pl.DataFrame({"a": [1], "b": [2]})
(df.select(pl.struct(pl.all()))
.select(pl.first().struct.field("a", "b").filter(pl.col("foo") == 1))
)
# thread '<unnamed>' panicked at crates/polars-plan/src/utils.rs:360:79:
# called `Result::unwrap()` on an `Err` value: ColumnNotFound(ErrString("foo"))
# PanicException: called `Result::unwrap()` on an `Err` value: ColumnNotFound(ErrString("foo"))
Log output
No response
Issue description
It only happens when selecting multiple fields.
With a single field, the error is raised as expected:
(df.select(pl.struct(pl.all()))
.select(pl.first().struct.field("a").filter(pl.col("foo") == 1))
)
# ColumnNotFoundError: "foo" not found
Checks
Reproducible example
Log output
No response
Issue description
It only happens when selecting multiple fields.
With a single field, the error is raised as expected:
Expected behavior
No panic.
Installed versions