Skip to content

Commit 6538419

Browse files
authored
Merge pull request #90 from raisadz/feat/list-sort
feat: add `list.sort`
2 parents 7f0f235 + 3e791ee commit 6538419

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
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)