@@ -124,6 +124,10 @@ def over(
124124 order = by , options
125125 return self ._from_ir (Over ().to_window_expr (self ._ir , partition , order ))
126126
127+ def sort (self , * , descending : bool = False , nulls_last : bool = False ) -> Self :
128+ options = SortOptions (descending = descending , nulls_last = nulls_last )
129+ return self ._from_ir (expr .Sort (expr = self ._ir , options = options ))
130+
127131 def sort_by (
128132 self ,
129133 by : DummyExpr | t .Iterable [DummyExpr ],
@@ -174,12 +178,11 @@ def fill_null(
174178 strategy : FillNullStrategy | None = None ,
175179 limit : int | None = None ,
176180 ) -> Self :
177- node : F .FillNullWithStrategy | F .FillNull
178- if strategy is not None :
179- node = F .FillNullWithStrategy (strategy = strategy , limit = limit )
180- else :
181- node = F .FillNull (value = parse .parse_into_expr_ir (value , str_as_lit = True ))
182- return self ._from_ir (node .to_function_expr (self ._ir ))
181+ if strategy is None :
182+ ir = parse .parse_into_expr_ir (value , str_as_lit = True )
183+ return self ._from_ir (F .FillNull ().to_function_expr (self ._ir , ir ))
184+ fill = F .FillNullWithStrategy (strategy = strategy , limit = limit )
185+ return self ._from_ir (fill .to_function_expr (self ._ir ))
183186
184187 def shift (self , n : int ) -> Self :
185188 return self ._from_ir (F .Shift (n = n ).to_function_expr (self ._ir ))
0 commit comments