From 663f31247a039a6fb4c533e94f20781fa286a630 Mon Sep 17 00:00:00 2001 From: GALI PREM SAGAR Date: Mon, 30 Jan 2023 15:15:17 -0600 Subject: [PATCH] Fix a mask data corruption in UDF (#12647) This PR fixes a mask data corruption issue encountered while working on https://github.com/rapidsai/cudf/pull/12619. `column_empty` actually returns un-initialized values, but we would want a fully initialized mask column here. Hence it is very inconsistent to test for a failure here, which is the reason it has been passing in CI and many of the local builds. Authors: - GALI PREM SAGAR (https://github.com/galipremsagar) Approvers: - https://github.com/brandon-b-miller - Ashwin Srinath (https://github.com/shwina) URL: https://github.com/rapidsai/cudf/pull/12647 --- python/cudf/cudf/core/indexed_frame.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/cudf/cudf/core/indexed_frame.py b/python/cudf/cudf/core/indexed_frame.py index c8016786be9..daf2502ee96 100644 --- a/python/cudf/cudf/core/indexed_frame.py +++ b/python/cudf/cudf/core/indexed_frame.py @@ -2124,7 +2124,9 @@ def _apply(self, func, kernel_getter, *args, **kwargs): # Mask and data column preallocated ans_col = _return_arr_from_dtype(retty, len(self)) - ans_mask = cudf.core.column.column_empty(len(self), dtype="bool") + ans_mask = cudf.core.column.full( + size=len(self), fill_value=True, dtype="bool" + ) output_args = [(ans_col, ans_mask), len(self)] input_args = _get_input_args_from_frame(self) launch_args = output_args + input_args + list(args)