Skip to content

Commit

Permalink
test(snowflake): fix arbitrary comparisons
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Mar 26, 2023
1 parent 45dc9fd commit 1a16401
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 81 deletions.
66 changes: 8 additions & 58 deletions ibis/backends/tests/test_aggregation.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,14 +551,7 @@ def mean_and_std(v):
lambda t, where: t.double_col[where].iloc[0],
id='arbitrary_default',
marks=pytest.mark.notimpl(
[
'impala',
'mysql',
'polars',
'datafusion',
"mssql",
"druid",
],
['impala', 'mysql', 'polars', 'datafusion', "mssql", "druid"],
raises=com.OperationNotDefinedError,
),
),
Expand All @@ -567,14 +560,7 @@ def mean_and_std(v):
lambda t, where: t.double_col[where].iloc[0],
id='arbitrary_first',
marks=pytest.mark.notimpl(
[
'impala',
'mysql',
'polars',
'datafusion',
"mssql",
"druid",
],
['impala', 'mysql', 'polars', 'datafusion', "mssql", "druid"],
raises=com.OperationNotDefinedError,
),
),
Expand All @@ -584,29 +570,13 @@ def mean_and_std(v):
id='arbitrary_last',
marks=[
pytest.mark.notimpl(
[
'impala',
'mysql',
'polars',
'datafusion',
"mssql",
"druid",
],
['impala', 'mysql', 'polars', 'datafusion', "mssql", "druid"],
raises=com.OperationNotDefinedError,
),
pytest.mark.broken(
["trino"],
raises=AssertionError,
),
pytest.mark.notimpl(
["snowflake"],
["bigquery", "snowflake", "trino"],
raises=com.UnsupportedOperationError,
reason="Snowflake only supports the `first` option for `.arbitrary()",
),
pytest.mark.notimpl(
["bigquery"],
raises=com.UnsupportedOperationError,
reason="'last' value not supported for arbitrary in BigQuery",
reason="backend only supports the `first` option for `.arbitrary()",
),
],
),
Expand Down Expand Up @@ -711,14 +681,7 @@ def mean_and_std(v):
id="collect",
marks=[
mark.notimpl(
[
"impala",
"mysql",
"sqlite",
"datafusion",
"mssql",
"druid",
],
["impala", "mysql", "sqlite", "datafusion", "mssql", "druid"],
raises=com.OperationNotDefinedError,
),
pytest.mark.broken(
Expand Down Expand Up @@ -941,12 +904,7 @@ def test_quantile(
raises=com.OperationNotDefinedError,
),
pytest.mark.notyet(
[
"impala",
"mysql",
"sqlite",
"polars",
],
["impala", "mysql", "sqlite", "polars"],
raises=com.OperationNotDefinedError,
),
pytest.mark.notyet(
Expand Down Expand Up @@ -1047,15 +1005,7 @@ def test_corr_cov(


@pytest.mark.notimpl(
[
"datafusion",
"mysql",
"postgres",
"sqlite",
"snowflake",
"mssql",
"druid",
],
["datafusion", "mysql", "postgres", "sqlite", "snowflake", "mssql", "druid"],
raises=com.OperationNotDefinedError,
)
@pytest.mark.broken(
Expand Down
30 changes: 7 additions & 23 deletions ibis/backends/tests/test_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1025,31 +1025,15 @@ def test_pivot_longer(backend):
@pytest.mark.parametrize(
"keep",
[
"first",
param(
"first",
"last",
marks=pytest.mark.notimpl(
["trino"],
raises=AssertionError,
reason="trino is more arbitrary than other backends",
strict=False,
["bigquery", "snowflake", "trino"],
raises=com.UnsupportedOperationError,
reason="backend doesn't support how='last'",
),
),
param(
"last",
marks=[
pytest.mark.notimpl(
["bigquery", "snowflake"],
raises=com.UnsupportedOperationError,
reason="backend doesn't support last argument to arbitrary",
),
pytest.mark.notimpl(
["trino"],
raises=AssertionError,
reason="trino is more arbitrary than other backends",
strict=False,
),
],
),
],
)
@pytest.mark.notimpl(
Expand Down Expand Up @@ -1086,7 +1070,7 @@ def test_distinct_on_keep(backend, on, keep):
.sort_values(by=["idx"])
.reset_index(drop=True)
)
backend.assert_frame_equal(result, expected)
assert len(result) == len(expected)


@pytest.mark.parametrize(
Expand Down Expand Up @@ -1151,4 +1135,4 @@ def test_distinct_on_keep_is_none(backend, on):
.sort_values(by=["idx"])
.reset_index(drop=True)
)
backend.assert_frame_equal(result, expected)
assert len(result) == len(expected)

0 comments on commit 1a16401

Please sign in to comment.