Skip to content

Commit

Permalink
test(dask): skip zeroifnull on older versions
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud authored and kszucs committed May 23, 2022
1 parent 38487db commit 5c96498
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions ibis/backends/tests/test_generic.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import decimal
import importlib
import io
import operator

Expand Down Expand Up @@ -559,8 +560,25 @@ def test_zeroifnull_literals(con, dtype, zero, expected):
)


DASK_WITH_FIXED_REPLACE = vparse("2022.01.1")


def skip_if_dask_replace_is_broken(backend):
if (name := backend.name()) != "dask":
return
if (
version := vparse(importlib.import_module(name).__version__)
) < DASK_WITH_FIXED_REPLACE:
pytest.skip(
f"{name}@{version} doesn't support this operation with later "
"versions of pandas"
)


@pytest.mark.notimpl(["datafusion"])
def test_zeroifnull_column(backend, alltypes, df):
skip_if_dask_replace_is_broken(backend)

expr = alltypes.int_col.nullif(1).zeroifnull()
result = expr.execute().astype("int32")
expected = df.int_col.replace(1, 0).rename("tmp").astype("int32")
Expand Down

0 comments on commit 5c96498

Please sign in to comment.