-
Notifications
You must be signed in to change notification settings - Fork 603
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(common): don't match an
Object
pattern with more positional arg…
…uments defined than `__match_args__` has
- Loading branch information
Showing
3 changed files
with
54 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from __future__ import annotations | ||
|
||
import ibis | ||
from ibis import _ | ||
|
||
|
||
def test_window_with_row_number_compiles(): | ||
# GH #8058: the add_order_by_to_empty_ranking_window_functions rule was | ||
# matching on `RankBase` subclasses with a pattern expecting an `arg` | ||
# attribute, which is not present on `RowNumber` | ||
expr = ( | ||
ibis.memtable({"a": range(30)}) | ||
.mutate(id=ibis.row_number()) | ||
.sample(fraction=0.25, seed=0) | ||
.mutate(is_test=_.id.isin(_.id)) | ||
.filter(~_.is_test) | ||
) | ||
assert ibis.to_sql(expr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters