Skip to content

Commit 2fd80fc

Browse files
committed
chore: add test
1 parent f32c35d commit 2fd80fc

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

ibis/backends/tests/test_aggregation.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,27 @@ def test_first_last_ordered(alltypes, method, filtered, include_null):
659659
assert res == sol
660660

661661

662+
@pytest.mark.notimpl(
663+
["databricks"],
664+
raises=com.UnsupportedOperationError,
665+
)
666+
@pytest.mark.notimpl(
667+
["polars"],
668+
raises=com.OperationNotDefinedError,
669+
)
670+
@pytest.mark.parametrize("method", ["first", "last"])
671+
def test_first_last_ordered_in_mutate(alltypes, method):
672+
# a test of a last and first inside a mutate operation is required because mutate
673+
# calls rewrite_project_input which wraps reductions with a WindowFunction
674+
# originally reported in issue #11656
675+
676+
sol = 0 if method == "last" else 9
677+
expr = alltypes.mutate(
678+
new=getattr(alltypes.int_col, method)(order_by=_.int_col.desc())
679+
)
680+
assert expr.execute()["new"].eq(sol).all()
681+
682+
662683
@pytest.mark.notimpl(
663684
[
664685
"druid",

0 commit comments

Comments
 (0)