Skip to content

Commit

Permalink
xfail tests in test_udf_masked_ops due to pandas 2.2 bug (#15071)
Browse files Browse the repository at this point in the history
Due to a change in pandas 2.2 with how NA is handled (incorrectly) in UDFs pandas-dev/pandas#57390

Authors:
  - Matthew Roeschke (https://github.com/mroeschke)

Approvers:
  - GALI PREM SAGAR (https://github.com/galipremsagar)

URL: #15071
  • Loading branch information
mroeschke authored Feb 20, 2024
1 parent 193ab6e commit d50c910
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion python/cudf/cudf/tests/test_udf_masked_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from numba import cuda

import cudf
from cudf.core._compat import PANDAS_GE_220
from cudf.core.missing import NA
from cudf.core.udf._ops import (
arith_ops,
Expand Down Expand Up @@ -482,6 +483,9 @@ def func(x):
run_masked_udf_series(func, data, check_dtype=False)


@pytest.mark.xfail(
PANDAS_GE_220, reason="https://github.com/pandas-dev/pandas/issues/57390"
)
def test_series_apply_null_conditional():
def func(x):
if x is NA:
Expand All @@ -506,6 +510,9 @@ def func(x):
run_masked_udf_series(func, data, check_dtype=False)


@pytest.mark.xfail(
PANDAS_GE_220, reason="https://github.com/pandas-dev/pandas/issues/57390"
)
@pytest.mark.parametrize("op", comparison_ops)
def test_series_compare_masked_vs_masked(op):
"""
Expand Down Expand Up @@ -562,6 +569,9 @@ def func(x):
run_masked_udf_series(func, data, check_dtype=False)


@pytest.mark.xfail(
PANDAS_GE_220, reason="https://github.com/pandas-dev/pandas/issues/57390"
)
def test_series_masked_is_null_conditional():
def func(x):
if x is NA:
Expand Down Expand Up @@ -742,8 +752,14 @@ def func(x, c):
],
)
@pytest.mark.parametrize("op", arith_ops + comparison_ops)
def test_masked_udf_scalar_args_binops_multiple_series(data, op):
def test_masked_udf_scalar_args_binops_multiple_series(request, data, op):
data = cudf.Series(data)
request.applymarker(
pytest.mark.xfail(
op in comparison_ops and PANDAS_GE_220 and data.dtype.kind != "b",
reason="https://github.com/pandas-dev/pandas/issues/57390",
)
)

def func(data, c, k):
x = op(data, c)
Expand Down

0 comments on commit d50c910

Please sign in to comment.