Skip to content

Commit 6713a4c

Browse files
committed
fix: add order_by to first and last
closes #11656
1 parent d7083c2 commit 6713a4c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ibis/backends/sql/rewrites.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ def first_to_firstvalue(_, **kwargs):
204204
"in a window function"
205205
)
206206
klass = FirstValue if isinstance(_.func, ops.First) else LastValue
207-
return _.copy(func=klass(_.func.arg))
207+
_kwargs = {k: v for k, v in (("order_by", _.func.order_by),) if v}
208+
return _.copy(func=klass(_.func.arg), **_kwargs)
208209

209210

210211
@replace(p.Alias)

0 commit comments

Comments
 (0)