From 55d7a1ce849a1edfcbfed6a054021d16f2ae3a22 Mon Sep 17 00:00:00 2001 From: galipremsagar Date: Tue, 10 Mar 2026 15:15:02 +0000 Subject: [PATCH 1/2] Fix all tests --- .../cudf/tests/dataframe/methods/test_apply.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/python/cudf/cudf/tests/dataframe/methods/test_apply.py b/python/cudf/cudf/tests/dataframe/methods/test_apply.py index 46f950b5f671..d106d5bb99c7 100644 --- a/python/cudf/cudf/tests/dataframe/methods/test_apply.py +++ b/python/cudf/cudf/tests/dataframe/methods/test_apply.py @@ -66,7 +66,9 @@ def run_masked_udf_test(func, data, args=(), nullable=True, **kwargs): pdf = data.to_pandas(nullable=nullable) expect = pdf.apply(func, args=args, axis=1) - obtain = gdf.apply(func, args=args, axis=1) + obtain = gdf.apply(func, args=args, axis=1).to_pandas(nullable=nullable) + if "check_dtype" in kwargs and not kwargs.get("check_dtype", True): + expect = expect.astype(obtain.dtype) assert_eq(expect, obtain, **kwargs) @@ -530,7 +532,6 @@ def func(row): gdf = cudf.DataFrame({"a": [1.5, None, 3, None], "b": [4, 5, None, None]}) gdf["a"] = gdf["a"].astype(numeric_types_as_str) gdf["b"] = gdf["b"].astype(numeric_types_as_str2) - run_masked_udf_test(func, gdf, check_dtype=False) @@ -673,8 +674,8 @@ def outer_gpu(row): y = row["b"] return inner_gpu(x, y) - got = gdf.apply(outer_gpu, axis=1) - expect = pdf.apply(outer, axis=1) + got = gdf.apply(outer_gpu, axis=1).to_pandas(nullable=True) + expect = pdf.apply(outer, axis=1).astype(got.dtype) assert_eq(expect, got, check_dtype=False) @@ -691,7 +692,7 @@ def func(row): return row["a"] + row["b"] data = cudf.DataFrame(data) - run_masked_udf_test(func, data) + run_masked_udf_test(func, data, check_dtype=False) @pytest.mark.parametrize( @@ -770,4 +771,6 @@ def func(row, c, k): y = binary_op(x, k) return y - run_masked_udf_test(func, data, args=(1, 2), check_dtype=False) + run_masked_udf_test( + func, data, args=(1, 2), check_dtype=False, nullable=True + ) From b92c6546420480a36284668d70321c4e7e9dbc62 Mon Sep 17 00:00:00 2001 From: GALI PREM SAGAR Date: Thu, 12 Mar 2026 10:08:26 -0500 Subject: [PATCH 2/2] Update test_apply.py --- python/cudf/cudf/tests/dataframe/methods/test_apply.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/cudf/cudf/tests/dataframe/methods/test_apply.py b/python/cudf/cudf/tests/dataframe/methods/test_apply.py index d106d5bb99c7..b6ae38580f16 100644 --- a/python/cudf/cudf/tests/dataframe/methods/test_apply.py +++ b/python/cudf/cudf/tests/dataframe/methods/test_apply.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 import decimal import math