Skip to content

Commit

Permalink
feat(snowflake): support reductions in window functions via automatic…
Browse files Browse the repository at this point in the history
… ordering
  • Loading branch information
cpcloud authored and kszucs committed Dec 6, 2022
1 parent 8f4808c commit 0234e5c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
1 change: 1 addition & 0 deletions ibis/backends/snowflake/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class SnowflakeExprTranslator(AlchemyExprTranslator):
ops.Lag,
ops.Lead,
)
_require_order_by = (*AlchemyExprTranslator._require_order_by, ops.Reduction)


class SnowflakeCompiler(AlchemyCompiler):
Expand Down
11 changes: 1 addition & 10 deletions ibis/backends/tests/test_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,13 +424,7 @@ def test_grouped_bounded_preceding_window(backend, alltypes, df, window_fn):
('ordered'),
[
param(True, id='ordered', marks=pytest.mark.notimpl(["dask", "pandas"])),
param(
False,
id='unordered',
marks=[
pytest.mark.notyet(["snowflake"], reason="backend requires ordering")
],
),
param(False, id='unordered'),
],
)
@pytest.mark.notimpl(["datafusion", "polars"])
Expand Down Expand Up @@ -486,9 +480,6 @@ def test_grouped_unbounded_window(
lambda df: pd.Series([df.double_col.mean()] * len(df.double_col)),
False,
id='unordered-mean',
marks=[
pytest.mark.notyet(["snowflake"], reason="backend requires ordering")
],
),
param(
lambda t, win: mean_udf(t.double_col).over(win),
Expand Down

0 comments on commit 0234e5c

Please sign in to comment.