22from typing import Any , Protocol
33
44import narwhals as nw
5+ from narwhals ._expression_parsing import ExprKind , ExprMetadata
56from narwhals .utils import flatten
67
78
@@ -10,16 +11,12 @@ class AnnselExpr(nw.Expr):
1011
1112 def __init__ (
1213 self ,
13- call : Callable [[Any ], Any ],
14+ to_compliant_expr : Callable [[Any ], Any ],
15+ metadata : ExprMetadata ,
1416 * names : Iterable [str ],
15- is_order_dependent : bool = False ,
16- changes_length : bool = False ,
17- aggregates : bool = False ,
1817 ) -> None :
19- self ._to_compliant_expr = call
20- self ._is_order_dependent = is_order_dependent
21- self ._changes_length = changes_length
22- self ._aggregates = aggregates
18+ self ._to_compliant_expr = to_compliant_expr
19+ self ._metadata = metadata
2320
2421 self .names = names
2522
@@ -65,7 +62,9 @@ def __call__(self, *names: str | Iterable[str]) -> AnnselExpr:
6562 def column_selector (plx : Any ):
6663 return plx .col (* flatten (names ))
6764
68- return AnnselExpr (column_selector , * flatten (names ))
65+ return AnnselExpr (
66+ column_selector , ExprMetadata (kind = ExprKind .TRANSFORM , is_order_dependent = False ), * flatten (names )
67+ )
6968
7069
7170col : Col = Col ()
0 commit comments