datasets.Dataset.sort() does not preserve ordering

It looks like sort() does not preserve ordering, and it does not support sorting on multiple columns, nor a key function.
Preserved ordering when sorting is very handy when one needs to sort on multiple columns, A and B, so that e.g. whenever A is equal for two or more rows, B is kept sorted.

In native Python one could do the latter (other than sorting by a key function specifying that) by sorting by B first, then by A.

What’s the recommended way to achieve this with :hugs:Datasets?

Hi ! I don’t think this case is supported right now, but feel free to open an issue on github in case someone would like to contribute this feature :slight_smile: We can imagine having something similar to pandas and be able to specify multiple columns for sorting. We’re already using pandas under the hood to do the sorting in datasets.

In the meantime feel free to convert your dataset to pandas and use df.sort_values !

Sounds good! Thanks.