Skip to content

Commit e6ca72b

Browse files
committed
fix: Remove ExprIR from Function bases
Resolves (#2572 (comment))
1 parent ae8cc5c commit e6ca72b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

narwhals/_plan/common.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,11 @@ def is_scalar(self) -> bool:
146146
return False
147147

148148

149-
class Function(ExprIR):
149+
class Function(Immutable):
150150
"""Shared by expr functions and namespace functions.
151151
152+
Only valid in `FunctionExpr.function`
153+
152154
https://github.com/pola-rs/polars/blob/112cab39380d8bdb82c6b76b31aca9b58c98fd93/crates/polars-plan/src/dsl/expr.rs#L114
153155
"""
154156

narwhals/_plan/expr.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,10 @@ class FunctionExpr(ExprIR, t.Generic[_FunctionT]):
180180
2. The union of (1) and any `FunctionOptions` in `inputs`
181181
"""
182182

183+
@property
184+
def is_scalar(self) -> bool:
185+
return self.function.is_scalar
186+
183187
def with_options(self, options: FunctionOptions, /) -> Self:
184188
options = self.options.with_flags(options.flags)
185189
return type(self)(input=self.input, function=self.function, options=options)

0 commit comments

Comments
 (0)