Skip to content

Commit 5e67936

Browse files
committed
test(mssql): add snapshot for rank with no frame
1 parent b97a65a commit 5e67936

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
SELECT
2+
[t0].[color],
3+
[t0].[price],
4+
RANK() OVER (PARTITION BY [t0].[color] ORDER BY CASE WHEN [t0].[price] IS NULL THEN 1 ELSE 0 END, [t0].[price] ASC) - 1 AS [MinRank()]
5+
FROM [diamonds_sample] AS [t0]
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from __future__ import annotations
2+
3+
import ibis
4+
5+
6+
def test_rank_no_window_frame(con, snapshot):
7+
t = ibis.table(schema=dict(color=str, price=int), name="diamonds_sample")
8+
expr = t.mutate(ibis.rank().over(group_by="color", order_by="price"))
9+
sql = ibis.to_sql(expr, dialect="mssql")
10+
11+
snapshot.assert_match(sql, "out.sql")

0 commit comments

Comments
 (0)