From 6bebfcb97a79841f73cfb0205b79e63957606331 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Mon, 12 Feb 2024 17:05:19 -0800 Subject: [PATCH 1/2] Add xfailures for test_applymap for pandas 2.2 --- python/cudf/cudf/tests/test_applymap.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/python/cudf/cudf/tests/test_applymap.py b/python/cudf/cudf/tests/test_applymap.py index 38a34c206d7..c52dfffce42 100644 --- a/python/cudf/cudf/tests/test_applymap.py +++ b/python/cudf/cudf/tests/test_applymap.py @@ -3,7 +3,7 @@ import pytest from cudf import NA, DataFrame -from cudf.core._compat import PANDAS_GE_210 +from cudf.core._compat import PANDAS_GE_210, PANDAS_GE_220 from cudf.testing import _utils as utils @@ -26,15 +26,27 @@ ], ) @pytest.mark.parametrize("na_action", [None, "ignore"]) -def test_applymap_dataframe(data, func, na_action): +def test_applymap_dataframe(data, func, na_action, request): + request.applymarker( + pytest.mark.xfail( + PANDAS_GE_220 + and request.node.callspec.id == "None-2-data3", + reason="https://github.com/pandas-dev/pandas/issues/57390", + ) + ) + request.applymarker( + pytest.mark.xfail( + PANDAS_GE_220 + and request.node.callspec.id == "ignore-3-data3", + reason="https://github.com/pandas-dev/pandas/pull/57388", + ) + ) gdf = DataFrame(data) pdf = gdf.to_pandas(nullable=True) - with utils.expect_warning_if(PANDAS_GE_210): expect = pdf.applymap(func, na_action=na_action) with pytest.warns(FutureWarning): got = gdf.applymap(func, na_action=na_action) - utils.assert_eq(expect, got, check_dtype=False) From 50027f69d9b2a9f0554cfb48cdc80d1ae5cf5ba4 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Mon, 12 Feb 2024 17:05:52 -0800 Subject: [PATCH 2/2] Whitespace --- python/cudf/cudf/tests/test_applymap.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/cudf/cudf/tests/test_applymap.py b/python/cudf/cudf/tests/test_applymap.py index c52dfffce42..adbbbbb1ae4 100644 --- a/python/cudf/cudf/tests/test_applymap.py +++ b/python/cudf/cudf/tests/test_applymap.py @@ -43,10 +43,12 @@ def test_applymap_dataframe(data, func, na_action, request): ) gdf = DataFrame(data) pdf = gdf.to_pandas(nullable=True) + with utils.expect_warning_if(PANDAS_GE_210): expect = pdf.applymap(func, na_action=na_action) with pytest.warns(FutureWarning): got = gdf.applymap(func, na_action=na_action) + utils.assert_eq(expect, got, check_dtype=False)