-
Notifications
You must be signed in to change notification settings - Fork 915
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 lists.sort_values
API
#7657
Merged
Merged
Changes from 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
6030947
Initial
isVoid 6fe171a
remove indirection, na_pos check
isVoid b8b884d
License year
isVoid 56e06c8
Use internal enum classes for order and null_order
isVoid 8c1b763
capture cpp exception
isVoid 574984a
Several docstring fixes, exposing lists API docs
isVoid 3d59f8f
Merge branch '7467' of github.com:isVoid/cudf into 7467
isVoid 7b36e63
Add nested list error msg
isVoid 029c00d
Merge branch 'branch-0.19' of https://github.com/rapidsai/cudf into 7467
isVoid e5ba902
style
isVoid 8acf8f0
Passing bool/str arg to cython
isVoid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Copyright (c) 2021, NVIDIA CORPORATION. | ||
|
||
from libcpp.memory cimport unique_ptr | ||
|
||
from cudf._lib.cpp.types cimport order, null_order | ||
from cudf._lib.cpp.column.column cimport column | ||
from cudf._lib.cpp.lists.lists_column_view cimport lists_column_view | ||
|
||
|
||
cdef extern from "cudf/lists/sorting.hpp" namespace "cudf::lists" nogil: | ||
cdef unique_ptr[column] sort_lists( | ||
const lists_column_view source_column, | ||
order column_order, | ||
null_order null_precedence | ||
) except + |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3571,6 +3571,7 @@ def sort_values( | |
4 3 | ||
3 4 | ||
1 5 | ||
dtype: int64 | ||
""" | ||
|
||
if inplace: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
Is there a way to more tightly type the enums here? I thought we had a pattern fo handling enum values like this elsewhere but I could be mistaken.
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.
Unfortunately no. I think typically we just pass a Python object to Cython, where we then plumb it through to the appropriate C++ type. See for example https://github.com/rapidsai/cudf/blob/branch-0.19/python/cudf/cudf/_lib/sort.pyx#L26.
I'd suggest we do something similar here, where the Cython API shouldn't expect a Python enum, but rather something like a string or a bool. That encapsulates things a little better, making the use of an enum an implementation detail.
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.
Apologies, @isVoid I got this backwards and you had it right from the beginning
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 think this needs to be addressed before merging
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.
Got it. Sorry misunderstood on this one!