Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions python/cudf/cudf/tests/series/methods/test_apply.py
Original file line number Diff line number Diff line change
@@ -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 operator

Expand All @@ -11,12 +11,14 @@
from cudf.testing import assert_eq


def run_masked_udf_series(func, data, args=(), **kwargs):
def run_masked_udf_series(func, data, args=(), nullable=True, **kwargs):
gsr = data
psr = data.to_pandas(nullable=True)
psr = data.to_pandas(nullable=nullable)

expect = psr.apply(func, args=args)
obtain = gsr.apply(func, args=args)
obtain = gsr.apply(func, args=args).to_pandas(nullable=nullable)
if "check_dtype" in kwargs and not kwargs.get("check_dtype", True):
expect = expect.astype(obtain.dtype, errors="ignore")
assert_eq(expect, obtain, **kwargs)


Expand Down
Loading