Skip to content

Commit 0982b3a

Browse files
committed
feat: Partially resolve FunctionExpr.options
- 1 step closer to the understanding for (#2572 (comment)) - There's still some magic going on when `polars` serializes - Need to track down where `'collect_groups': 'ElementWise'` and `'collect_groups': 'GroupWise'` first appear - Seems like the flags get reduced
1 parent a0f7c9b commit 0982b3a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

narwhals/_plan/common.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,11 @@ def is_scalar(self) -> bool:
173173

174174
def to_function_expr(self, *inputs: ExprIR) -> FunctionExpr[Self]:
175175
from narwhals._plan.expr import FunctionExpr
176-
from narwhals._plan.options import FunctionOptions
177176

178-
# NOTE: Still need to figure out how these should be generated
179-
# Feel like it should be the union of `input` & `function`
180-
PLACEHOLDER = FunctionOptions.default() # noqa: N806
181-
return FunctionExpr(input=inputs, function=self, options=PLACEHOLDER)
177+
# NOTE: Still need to figure out if using a closure is needed
178+
options = self.function_options
179+
# https://github.com/pola-rs/polars/blob/dafd0a2d0e32b52bcfa4273bffdd6071a0d5977a/crates/polars-plan/src/dsl/expr.rs#L442-L450.
180+
return FunctionExpr(input=inputs, function=self, options=options)
182181

183182

184183
_NON_NESTED_LITERAL_TPS = (

0 commit comments

Comments
 (0)