[FEA] Support na_position
for cudf.DataFrame.sort_values
when ascending
is sequence of booleans
#9400
Labels
Milestone
Is your feature request related to a problem? Please describe.
It is not currently possible to provide
sort_values
with a list of boolean forascending
as well as a non-default value forna_position
. Doing so raises a warning, and does not take the value ofna_position
into account:Describe the solution you'd like
It would be nice if cuDF had the same behavior as Pandas here, which is able to handle both the list of
ascending
values and thena_position
:Describe alternatives you've considered
I'm pretty sure cuDF still properly sorts the columns with null values, so it should be possible to split the resulting dataframe up into null and non-null parts and concat it together to achieve the desired null positioning - I imagine this is sub-optimal.
Additional context
This is coming up while doing work on dask-sql sorting - in some cases, we can rely directly on cuDF/Pandas
sort_values
, but additional checks need to be made for cuDF due to this behavior. See dask-contrib/dask-sql#229 (comment) for more details.The text was updated successfully, but these errors were encountered: