test: cover two ash_sql sort bugs - #858
Merged
zachdaniel merged 1 commit intoSep 19, 2026
Merged
zachdaniel merged 1 commit into
zachdaniel merged 1 commit into
Conversation
Sorted uniq? aggregates: two shapes that produced `array_agg(DISTINCT x ORDER BY y)` and failed with postgres 42P10 — an aggregate carrying its own `sort`, and one inheriting a `sort` from the relationship it traverses. Join subquery sorts: `Comment.sorted_post` points at a read action that sorts, so the join subquery built for that belongs_to carried an ORDER BY the join immediately discards. Also asserts the read action still sorts when read directly. Both require the matching ash_sql fix.
7 tasks
Contributor
|
🚀 Thank you for your contribution! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These tests show two sort bugs in ash_sql. The fix is in ash-project/ash_sql#263. Three of the five tests fail without the fix.
The other two tests pass with the fix and without it. This is correct. They make sure that the fix does not remove all sorts. One commit contains all the tests, because post.ex has changes for both tests.
Contributor checklist
Leave anything that you believe does not apply unchecked.