From c4ef23f5d04aa7c77509b3f909313e21199d46ef Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Sat, 17 Feb 2024 07:29:54 -0500 Subject: [PATCH] test(dask): enable a bunch of sorting related now-xpassing tests --- ibis/backends/dask/tests/test_operations.py | 7 ++++++- ibis/backends/tests/test_aggregation.py | 2 +- ibis/backends/tests/test_generic.py | 10 ++++++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/ibis/backends/dask/tests/test_operations.py b/ibis/backends/dask/tests/test_operations.py index 71abfeb40f49..e43e5af45493 100644 --- a/ibis/backends/dask/tests/test_operations.py +++ b/ibis/backends/dask/tests/test_operations.py @@ -7,11 +7,13 @@ import numpy.testing as npt import pandas as pd import pytest +from packaging.version import parse as vparse from pytest import param import ibis import ibis.expr.datatypes as dt +dask = pytest.importorskip("dask") da = pytest.importorskip("dask.array") dd = pytest.importorskip("dask.dataframe") @@ -446,7 +448,10 @@ def test_series_limit(t, df, offset): ) -@pytest.mark.xfail(reason="TODO - sorting - #2553") +@pytest.mark.xfail( + condition=vparse(dask.__version__) < vparse("2024.2.0"), + reason="not implemented until 2024.2.0", +) def test_complex_order_by(t, df): expr = t.order_by([ibis.desc(t.plain_int64 * t.plain_float64), t.plain_float64]) result = expr.compile() diff --git a/ibis/backends/tests/test_aggregation.py b/ibis/backends/tests/test_aggregation.py index fb49a7f800da..b8be0619d0f9 100644 --- a/ibis/backends/tests/test_aggregation.py +++ b/ibis/backends/tests/test_aggregation.py @@ -1594,7 +1594,7 @@ def test_group_concat_over_window(backend, con): backend.assert_frame_equal(result, expected) -@pytest.mark.notimpl(["dask"], raises=NotImplementedError) +@pytest.mark.xfail_version(dask=["dask<2024.2.0"]) def test_value_counts_on_expr(backend, alltypes, df): expr = alltypes.bigint_col.add(1).value_counts() columns = expr.columns diff --git a/ibis/backends/tests/test_generic.py b/ibis/backends/tests/test_generic.py index d0430e859d4a..ecc629d0c4f5 100644 --- a/ibis/backends/tests/test_generic.py +++ b/ibis/backends/tests/test_generic.py @@ -537,12 +537,12 @@ def test_select_sort_sort(alltypes): param( ["id", "int_col"], {"by": ["id", "int_col"]}, - marks=pytest.mark.notimpl(["dask"]), + marks=pytest.mark.xfail_version(dask=["dask<2024.2.0"]), ), param( ["id", ibis.desc("int_col")], {"by": ["id", "int_col"], "ascending": [True, False]}, - marks=pytest.mark.notimpl(["dask"]), + marks=pytest.mark.xfail_version(dask=["dask<2024.2.0"]), ), ], ) @@ -849,13 +849,13 @@ def test_typeof(con): @pytest.mark.notyet(["impala"], reason="can't find table in subquery") @pytest.mark.notimpl(["datafusion", "druid"]) @pytest.mark.notimpl(["pyspark"], condition=is_older_than("pyspark", "3.5.0")) -@pytest.mark.notyet(["dask"], reason="not supported by the backend") @pytest.mark.notyet(["exasol"], raises=ExaQueryError, reason="not supported by exasol") @pytest.mark.broken( ["risingwave"], raises=PsycoPg2InternalError, reason="https://github.com/risingwavelabs/risingwave/issues/1343", ) +@pytest.mark.xfail_version(dask=["dask<2024.2.0"]) def test_isin_uncorrelated( backend, batting, awards_players, batting_df, awards_players_df ): @@ -876,7 +876,9 @@ def test_isin_uncorrelated( @pytest.mark.broken(["polars"], reason="incorrect answer") @pytest.mark.notimpl(["druid"]) -@pytest.mark.notyet(["dask"], reason="not supported by the backend") +@pytest.mark.xfail_version( + dask=["dask<2024.2.0"], reason="not supported by the backend" +) def test_isin_uncorrelated_filter( backend, batting, awards_players, batting_df, awards_players_df ):