Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've made a few changes based on the feedback from the cudf implementation PR I've submit still under review.
There 3 main refactoring (one for each commit):
buffer_to_ndarray
method is convert the protocol dtype to numpy one. I've refactored it in a dedicated method as in cudf implementation, I needed it a dozen of times so this might be the case for pandas in near future. Also this method used some local constants that I've moved into module level constant. This will prevent to recreate these variables for each call.__dlpack_device__
method to the module level as_DtypeKind
. Then I've add all the devices values so that the code will show which are currently support and maintainers will know directly about future device supports.convert_string_column
return all buffers whilebuffer_to_ndarray
andconvert_categorical_column
return only the data buffer. So I've set these latter to return all buffers as well.