Skip to content

Commit

Permalink
test: add test for impurity of self join
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Oct 8, 2024
1 parent de49350 commit 552c2cf
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions ibis/backends/tests/test_impure.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,14 @@ def test_impure_uncorrelated_same_id(alltypes, impure):
assert (df.x != df.y).any()


def test_self_join_with_generated_keys(con, monkeypatch):
monkeypatch.setattr(ibis.options, "default_backend", con)
left = ibis.range(5).unnest().name("idx").as_table().mutate(key=ibis.uuid())
@pytest.mark.notyet(
["duckdb", "sqlite"],
raises=AssertionError,
reason="instances are not correlated but ideally they would be",
)
def test_self_join_with_generated_keys(con):
left = ibis.memtable({"idx": list(range(5))}).mutate(key=ibis.uuid())
right = left.filter(left.idx < 3)
expr = left.join(right, "key")
result = expr.execute()
result = con.execute(expr)
assert result.shape == (3, 2)

0 comments on commit 552c2cf

Please sign in to comment.