Skip to content

Commit 3bc1b5c

Browse files
committed
fix: any and all functions should not have default frame or order_by
1 parent dbdd131 commit 3bc1b5c

3 files changed

Lines changed: 13 additions & 5 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
SELECT
2+
*
3+
FROM `t` AS `t0`
4+
QUALIFY
5+
LOGICAL_OR(`t0`.`a` = 'hello') OVER (PARTITION BY `t0`.`x` ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)

ibis/backends/bigquery/tests/unit/test_compiler.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,3 +711,10 @@ def test_unreasonably_long_name():
711711
match="BigQuery does not allow column names longer than 300 characters",
712712
):
713713
ibis.to_sql(expr, dialect="bigquery")
714+
715+
716+
def test_window_filter(snapshot):
717+
t = ibis.table([("a", "string"), ("x", "int64")], name="t")
718+
expr = t.filter((_.a == "hello").any().over(group_by=_.x))
719+
result = to_sql(expr)
720+
snapshot.assert_match(result, "out.sql")

ibis/backends/sql/rewrites.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -524,11 +524,7 @@ def exclude_unsupported_window_frame_from_rank(_, **kwargs):
524524
)
525525

526526

527-
@replace(
528-
p.WindowFunction(
529-
p.Lag | p.Lead | p.PercentRank | p.CumeDist | p.Any | p.All, start=None
530-
)
531-
)
527+
@replace(p.WindowFunction(p.Lag | p.Lead | p.PercentRank | p.CumeDist, start=None))
532528
def exclude_unsupported_window_frame_from_ops(_, **kwargs):
533529
return _.copy(start=None, end=0, order_by=_.order_by or (ops.NULL,))
534530

0 commit comments

Comments
 (0)