[BUG] result indices in group_argmin
was not initialized to -1 as comment says
#16542
Labels
bug
Something isn't working
Describe the bug
In sorted-based
group_argmin
's comment it says that theindices
was initialized toARGMIN_SENTINEL
but it was not in the current code.cudf/cpp/src/groupby/sort/group_argmin.cu
Lines 45 to 50 in e5f8dd3
Steps/Code to reproduce bug
Current code will contains null value with mask set and value of 0 (instead of -1). So the following
gather_if
seems to be unnecessary because the predicate will always be true:cudf/cpp/src/groupby/sort/group_argmin.cu
Line 58 in e5f8dd3
It will also affect the logic of
min
which usesargmin
cudf/cpp/src/groupby/hash/groupby.cu
Lines 235 to 240 in e5f8dd3
It didn't show any correctness issues under my tests and I don't think it did the wrong thing but the comment is confusing.
Expected behavior
We can remove the comment and update the related code, like using
gather
instead ofgather_if
, if the initialization is really not needed. Or if it's a bug we need to fix it.Additional context
group_argmax
also has the same issue.The text was updated successfully, but these errors were encountered: