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
[feature] #3116: Add sorting of any values (not only u128) #3118
[feature] #3116: Add sorting of any values (not only u128) #3118
Conversation
Codecov Report
@@ Coverage Diff @@
## iroha2-dev #3118 +/- ##
==============================================
+ Coverage 62.33% 64.53% +2.20%
==============================================
Files 169 172 +3
Lines 31218 34188 +2970
==============================================
+ Hits 19459 22063 +2604
- Misses 11759 12125 +366
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
c7a35ee
to
0c7fd8d
Compare
Also, @arndey suggests adding one more query parameter to specify what the sorting should do with unsortable elements. For example, |
To me it's sound like unnecessary complications on the backend side. |
@Erigara we have to choose one of the behavior algorithms anyway if we aren't going to implement @arndey suggestion. The current implementation in this PR is to place unsortable elements at the head of a result list. If it's okay, let's merge it. |
|
0c7fd8d
to
e0ca8b0
Compare
Dear reviewers, Andrey (@arndey) and I decided to change the algorithm for ordering unsortable elements, so now it places unsortable elements at the tail of a result list. And it makes sense. That implementation is more convenient for manipulating a result list. For example, The previous implementation returned => [ |
e0ca8b0
to
49109c2
Compare
Signed-off-by: Vladimir Pesterev <pesterev@pm.me>
49109c2
to
9686570
Compare
Signed-off-by: Vladimir Pesterev pesterev@pm.me
Description of the Change
Now we can sort by any values from metadata. Not only by u128. Also, this sorting implementation places all elements that cannot be sorted at the head of a result list.
Issue
Resolves #3116
Benefits
Better sorting feature.
Possible Drawbacks
None
Usage Examples or Tests [optional]
Take a look at tests in these changes.
Alternate Designs [optional]
Another design is to remove all elements that we can't sort.