Skip to content
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

Results sort_by() method does not behave as expected #459

Open
rbyh opened this issue May 8, 2024 · 4 comments
Open

Results sort_by() method does not behave as expected #459

rbyh opened this issue May 8, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@rbyh
Copy link
Contributor

rbyh commented May 8, 2024

I expect it to sort fields in the order that I have applied it, but it does it in reverse:
image

@rbyh rbyh added the enhancement New feature or request label May 8, 2024
@johnjosephhorton
Copy link
Contributor

Can you say a bit more here - what's the expected behavior?

@rbyh
Copy link
Contributor Author

rbyh commented May 10, 2024

If I sort by column A, and then by column B, I expect column A to remain the first sorted thing (like SQL). But it does the reverse -- it makes column B the first sorted thing.

@johnjosephhorton
Copy link
Contributor

I see. This might be challenging because it would require the dataset to have a "memory" of what is sorted by and I'd prefer to keep it stateless. What about is sorted could take multiple keys, like this:

results.sort_by('a', 'b')

which would sort by a, then b.

@rbyh
Copy link
Contributor Author

rbyh commented May 10, 2024

Yes, I would prefer sort_by('a', 'b') but I thought we discussed a reason to not do it that way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants