order_by(self, func=identity, descending=False)
Hello,
I noticed
https://github.com/sixty-north/asq/blob/db0c4cbcf2118435136d4b63c62a12711441088e/asq/queryables.py#L609
and
https://github.com/sixty-north/asq/blob/db0c4cbcf2118435136d4b63c62a12711441088e/asq/parallel_queryable.py#L166
I wonder if having descending keyword couldn't be a nice API improvement.
when descending is True, order_by_descending will be called.
What is your opinion?
Kind regards
What about an enum? order_by(order=ascending) or order_by(order=descending)
enum or boolean. It is as you want. My idea was using boolean, as in reverse parameter of sorted function
sorted(iterable, /, *, key=None, reverse=False)
or in Pandas DataFrame.sort_values method with ascending parameter
DataFrame.sort_values(by, axis=0, ascending=True, inplace=False, kind='quicksort', na_position='last', ignore_index=False, key=None)[source]
A boolean is simpler because it avoid having to import these enum values. but I noticed in your code that you are using order (-1 or 1) which is an other possibility