diff --git a/cpp/tests/groupby/host_udf_example_tests.cu b/cpp/tests/groupby/host_udf_example_tests.cu index 6f2affd2cad..a454bd692fc 100644 --- a/cpp/tests/groupby/host_udf_example_tests.cu +++ b/cpp/tests/groupby/host_udf_example_tests.cu @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -166,7 +167,9 @@ struct host_udf_groupby_example : cudf::host_udf_base { { auto const start = offsets[idx]; auto const end = offsets[idx + 1]; - if (start == end) { return {OutputType{0}, -1}; } + + auto constexpr invalid_idx = cuda::std::numeric_limits::lowest(); + if (start == end) { return {OutputType{0}, invalid_idx}; } auto sum_sqr = OutputType{0}; bool has_valid{false}; @@ -177,7 +180,7 @@ struct host_udf_groupby_example : cudf::host_udf_base { sum_sqr += val * val; } - if (!has_valid) { return {OutputType{0}, -1}; } + if (!has_valid) { return {OutputType{0}, invalid_idx}; } return {static_cast(group_indices[start] + 1) * sum_sqr - static_cast(group_max[idx]) * static_cast(group_sum[idx]), idx};