From d50c9107da35ef40e8262e4cbac5e48fdd1747a4 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Tue, 20 Feb 2024 03:57:05 -1000 Subject: [PATCH] xfail tests in test_udf_masked_ops due to pandas 2.2 bug (#15071) Due to a change in pandas 2.2 with how NA is handled (incorrectly) in UDFs https://github.com/pandas-dev/pandas/issues/57390 Authors: - Matthew Roeschke (https://github.com/mroeschke) Approvers: - GALI PREM SAGAR (https://github.com/galipremsagar) URL: https://github.com/rapidsai/cudf/pull/15071 --- python/cudf/cudf/tests/test_udf_masked_ops.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/python/cudf/cudf/tests/test_udf_masked_ops.py b/python/cudf/cudf/tests/test_udf_masked_ops.py index 0e29d2bfdcc..ed3461578fd 100644 --- a/python/cudf/cudf/tests/test_udf_masked_ops.py +++ b/python/cudf/cudf/tests/test_udf_masked_ops.py @@ -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, @@ -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: @@ -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): """ @@ -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: @@ -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)