Skip to content

Commit

Permalink
add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Chloe He committed Jul 1, 2024
1 parent 149843d commit 27d3cc4
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions ibis/tests/expr/test_temporal_windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,26 @@ def test_window_by_group_by_agg(table, method, by):
}
)
assert expr.schema() == expected_schema


@pytest.mark.parametrize(
"method",
[
methodcaller("tumble", size=ibis.interval(minutes=15)),
methodcaller(
"hop", size=ibis.interval(minutes=15), slide=ibis.interval(minutes=1)
),
],
ids=["tumble", "hop"],
)
def test_window_by_global_agg(table, method):
expr = method(table.window_by(time_col=table.i))
expr = expr.agg(a_sum=_.a.sum())
expected_schema = ibis.schema(
{
"window_start": "timestamp",
"window_end": "timestamp",
"a_sum": "int64",
}
)
assert expr.schema() == expected_schema

0 comments on commit 27d3cc4

Please sign in to comment.