This repository was archived by the owner on Dec 1, 2025. It is now read-only.
add wrapper for sort_values #88
Merged
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.
Resolves #86
Adds a wrapper for sort_values. This one is a bit different than the usual wrapper as dask has more of it's own functionality because sorting is a much more dask-sensitive operation. This is kind of a crude solution, but we effectively just call dasks sort_values when not sorting on nested layers, but then call a map_partitioned version of nested-pandas sort_values when working on nested layers.
These really act as two different functions under the same namespace, as top-level sorting invokes the neccesary parallelization and consequences of a shuffle that you'd expect with dask, dropping divisions. But sorting on nested layers is a contained problem that avoids dask shuffles and preserves the divisions information. We could break these out, but I think it would be better to make the functionality "feel" like nested-pandas so that would instead motivate breaking the functions out at the nested-pandas level too. The main issue I have with keeping them as one is that the kwarg set is subtly switching from one API to the other, and so things like optional kwargs may be confusing if a user switches their sorting from base->nested or vice-versa.
^But realistically, it may be fine to keep these as a single modified function until we get feedback that it's confusing in real use cases?