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

Sorting isn't applied when combined with a date-based grouping #4086

Open
zackkrida opened this issue Dec 17, 2024 · 1 comment
Open

Sorting isn't applied when combined with a date-based grouping #4086

zackkrida opened this issue Dec 17, 2024 · 1 comment
Labels
affects: ux Related to user experience needs: clarification needs: implementation specs We need clarity on HOW we'll implement it from a technical perspective type: bug Something isn't working

Comments

@zackkrida
Copy link
Contributor

Description

It is unclear how sorting and grouping by date interact with each other. For example:

If I sort by total_charge DESCENDING things look right:

image

Likewise, if I group by transaction_type things look fine:

image

If I group by a date column, things look okay:

image

And finally, if I group by a date and sort, the sort is no longer applied:

image

You can see by the icon that we're meant to be sorting by total_charge, yet no such sort is applied.

Expected behavior

The rows should be sorted within their groupings, as works for other types of groups.

@zackkrida zackkrida added type: bug Something isn't working needs: triage This issue has not yet been reviewed by a maintainer labels Dec 17, 2024
@mathemancer
Copy link
Contributor

mathemancer commented Dec 17, 2024

Neat bug.

This is specific to grouping with preproc (in this case, because you're grouping by month, day rather than the whole date), and not because of the "date" aspect itself.

The front end is sending a request with the order specified to be by the transaction_date column, then the total_charge column, and also specifying a grouping by month, day on the transaction_date column. The back end is faithfully carrying out those instructions, as seen in the results shown. Note that the primary sort is actually the full date shown in the transaction_date column.

Possible solutions:

  • We add a parameter to instruct "order by group ID", so the front end doesn't need to submit the grouping column as part of the ordering, but submits that instead.
  • The front end does its own ordering of the results retrieved w.r.t. grouping, so we don't need to submit any order w.r.t. the grouping information at all.
  • We add functionality to allow sorting by a preproc value, and have the front end submit that. This is my favorite, since it (correctly) avoids mixing up grouping and ordering.

I'd like to avoid just auto-ordering by group ID in the back end, since that mixes querying and display concerns, and is generally quite messy logically.

Triage considerations:

  • I don't think this is a regression (but we should verify)
  • The "proper" solutions are a bit high effort, and may require some design
  • We should probably not worry about it for beta.

@zackkrida zackkrida added affects: ux Related to user experience needs: implementation specs We need clarity on HOW we'll implement it from a technical perspective needs: clarification and removed needs: triage This issue has not yet been reviewed by a maintainer labels Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects: ux Related to user experience needs: clarification needs: implementation specs We need clarity on HOW we'll implement it from a technical perspective type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants