Skip to content

fix(expr-ir): Allow struct.field to select from it's own context#3654

Merged
dangotbanned merged 3 commits into
oh-nodesfrom
expr-ir/fix-struct-field-lazy
May 25, 2026
Merged

fix(expr-ir): Allow struct.field to select from it's own context#3654
dangotbanned merged 3 commits into
oh-nodesfrom
expr-ir/fix-struct-field-lazy

Conversation

@dangotbanned
Copy link
Copy Markdown
Member

Description

The equivalent of this was previously raising:

>>> import polars as pl
>>> pl.select(pl.lit({"a": 1, "b": 2}).struct.field("b"), eager=False).collect()
shape: (1, 1)
┌─────┐
│ b   │
│ --- │
│ i64 │
╞═════╡
│ 2   │
└─────┘

Related issues

- Follow-up to a bug found in #3647
- The test I wrote also forgot the first level of nesting
Comment thread src/narwhals/_plan/expressions/struct.py Outdated
@dangotbanned dangotbanned marked this pull request as ready for review May 25, 2026 21:56
@dangotbanned dangotbanned merged commit c5719de into oh-nodes May 25, 2026
37 of 38 checks passed
@dangotbanned dangotbanned deleted the expr-ir/fix-struct-field-lazy branch May 25, 2026 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant