Skip to content

Commit 3e791ee

Browse files
committed
feat: add list.sort
1 parent bb3bf17 commit 3e791ee

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

narwhals_daft/expr_list.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ def func(expr: Expression) -> Expression:
4141

4242
return self.compliant._with_elementwise(func)
4343

44+
def sort(self, *, descending: bool, nulls_last: bool) -> DaftExpr:
45+
return self.compliant._with_elementwise(
46+
lambda expr: F.list_sort(expr, desc=descending, nulls_first=not nulls_last)
47+
)
48+
4449
unique = not_implemented()
4550
contains = not_implemented()
4651
get = not_implemented()

0 commit comments

Comments
 (0)