Skip to content

Commit

Permalink
chore: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Oct 8, 2024
1 parent 552c2cf commit e09d66d
Showing 1 changed file with 27 additions and 16 deletions.
43 changes: 27 additions & 16 deletions ibis/backends/tests/test_impure.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,14 @@
import ibis
import ibis.common.exceptions as com
from ibis import _
from ibis.backends.tests.errors import (
PsycoPg2InternalError,
Py4JJavaError,
PyDruidProgrammingError,
)
from ibis.backends.tests.errors import PsycoPg2InternalError, Py4JJavaError

tm = pytest.importorskip("pandas.testing")

pytestmark = pytest.mark.xdist_group("impure")

no_randoms = [
pytest.mark.notimpl(["polars"], raises=com.OperationNotDefinedError),
pytest.mark.notimpl("druid", raises=PyDruidProgrammingError),
pytest.mark.notimpl(["polars", "druid"], raises=com.OperationNotDefinedError),
pytest.mark.notyet(
"risingwave",
raises=PsycoPg2InternalError,
Expand Down Expand Up @@ -135,9 +130,7 @@ def test_chained_selections(alltypes, impure):
lambda _: ibis.random(),
marks=[
*no_randoms,
pytest.mark.notyet(
["impala", "trino"], reason="instances are correlated"
),
pytest.mark.notyet(["impala"], reason="instances are correlated"),
],
id="random",
),
Expand All @@ -146,9 +139,7 @@ def test_chained_selections(alltypes, impure):
lambda _: ibis.uuid().cast(str).contains("a").ifelse(1, 0),
marks=[
*no_uuids,
pytest.mark.notyet(
["mysql", "trino"], reason="instances are correlated"
),
pytest.mark.notyet(["mysql"], reason="instances are correlated"),
],
id="uuid",
),
Expand Down Expand Up @@ -191,13 +182,33 @@ def test_impure_uncorrelated_same_id(alltypes, impure):


@pytest.mark.notyet(
["duckdb", "sqlite"],
[
"duckdb",
"clickhouse",
"datafusion",
"mysql",
"impala",
"mssql",
"trino",
"flink",
"bigquery",
],
raises=AssertionError,
reason="instances are not correlated but ideally they would be",
)
@pytest.mark.notyet(
["sqlite"],
raises=AssertionError,
reason="instances are *sometimes* correlated but ideally they would always be",
strict=False,
)
@pytest.mark.notimpl(
["polars", "risingwave", "druid", "exasol", "oracle", "pyspark"],
raises=com.OperationNotDefinedError,
)
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 = con.execute(expr)
assert result.shape == (3, 2)
result = con.execute(expr.count())
assert result == 3

0 comments on commit e09d66d

Please sign in to comment.