-
Notifications
You must be signed in to change notification settings - Fork 391
Open
Milestone
Description
This is an expanded description of the improvement to sort's API mentioned in #1307.
Currently, sort() separates the columns to sort in the key argument, and only supports sorting ascending or descending for all columns specified via the ascending boolean argument.
The improvement here is to allow the user to specify ascending and descending sort on a per-column basis.
The API will look something like:
expr.sort(bz.asc(expr.a), bz.desc(expr.b))Equivalent variants:
expr.sort(bz.asc('a'), bz.desc('b')) # strings supported
expr.sort(bz.asc(expr.a), bz.desc('b')) # mixed mode supported
expr.sort('a', bz.desc('b')) # if not specified, defaults to ascending.
expr.sort(expr.a.asc(), expr.b.desc()) # method-call form.Tasks:
- implement new
ascanddescexpressions. - implement validation logic to ensure that
ascanddescare only used in a sorting context. - re-implement
sort()to acceptascanddescexpression objects. - re-implement
sort()on pandas - re-implement
sort()on SQL. - tests...