-
Notifications
You must be signed in to change notification settings - Fork 921
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add pylibcudf.null_mask.null_count #17711
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good to me. I had one clarifying question and doc string suggestion (both non-blocking).
@@ -148,3 +150,28 @@ cpdef tuple bitmask_or(list columns): | |||
c_result = cpp_null_mask.bitmask_or(c_table.view()) | |||
|
|||
return buffer_to_python(move(c_result.first)), c_result.second | |||
|
|||
|
|||
cpdef size_type null_count(Py_ssize_t bitmask, size_type start, size_type stop): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you using Py_ssize_t
over int
because the bitmask
is essentially an index to a python buffer object? And according to this stackoverflow post. Py_ssize_t
preffered over int
when indexing into python objects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was matching the ptr
type of int_to_void_ptr
here. Additionally, using int
here would result in an OverflowError
Co-authored-by: Matthew Murray <[email protected]>
/merge |
Description
A small step to not have
null_count
tied tocudf._lib.column.Column
Checklist