perf(expr-ir): Optimize ExpansionFlags.from_ir#3206
Conversation
- Related #2572 (comment) - Child of #2572
|
@FBruzzesi thought I'd ping you as this part of the code reminded me of #2836 Was curious if you saw a way to do this in fewer steps? 😏 I think the only parts that would require some digging to know are This branch is covering 3x subclasses: narwhals/narwhals/_plan/_expansion.py Line 140 in 2a48aa6 narwhals/narwhals/_plan/expressions/expr.py Line 449 in 2a48aa6 narwhals/narwhals/_plan/expressions/expr.py Line 462 in 2a48aa6 narwhals/narwhals/_plan/expressions/expr.py Line 475 in 2a48aa6 But all the others are for these guys: narwhals/narwhals/_plan/expressions/expr.py Lines 104 to 149 in 2a48aa6 |
What type of PR is this? (check all applicable)
Related issues
ExprIR #2572 (comment)ExprIR #2572Checklist
Description
At least until switching over to (pola-rs/polars#23351), this is a simple optimization that takes advantage of defining a class hierarchy 😄
The method was originally a port of some upstream code, but skipped the
pl.col(pl.DataType)and struct/field stuff which we don't use: