-
-
Notifications
You must be signed in to change notification settings - Fork 337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
find.le broken with negative sorts #1352
Comments
It is indeed intentional that The difference between As for any other awkward corners, please check them using |
Ok, I feel convinced by the design (Yay!), but not the names/documentation. I personally feel torn between the concise abbreviations these well-known comparators provide and the fact that their meaning is stretched here. It would be more accurate to use the terms you quoted above, but much less concise, so I suppose my recommendation is to improve documentation. I'll make a quick PR based on your helpful comments above and link it here when it's done. |
I'll just note that the terms |
In making my proposed changes to the docs, I noticed it gets even more complicated in the |
Here's my docs PR FWIW. |
I'm only leaving this open in case the authors want to create aliases for these methods:
Or some other analogous scheme (maybe replacing |
Describe the current behavior
Currently, if I sort the values 1,2, and 3 in an
ID
column with:Then, the row for 2 will return 3 as "less than" it, which is plainly false.
Steps to reproduce
descend-less-than
Describe the expected behavior
In this context, I would expect
lt
on a negative (descending) sort to still return some value that is in fact less than 2 (i.e. 1).It seems that the comparison methods have different meanings:
lt
-> "previous"le
,ge
-> "current"gt
-> "next"If this is intentional, then it should be a lot clearer in the documentation and ideally the names. Also, it's apparent that there isn't really a difference between
le
andge
(unless these can be used to return multiple results somehow, maybe without afind
).It is also very strange that the sort is based on a string (is that sqlite?). The way the negative sign is interpreted seems to be the source of the nonsensical result. Could we just do away with the string altogether and use a value (or tuple of values)? That would also fix another bug.
Where have you encountered this bug?
Instance information (when self-hosting only)
No response
The text was updated successfully, but these errors were encountered: