Skip to content

test: cover uniq? list aggregates sorted by a varchar field - #906

Merged
zachdaniel merged 1 commit into
ash-project:mainfrom
pcapel:fix/uniq-list-aggregate-sort-cast
Oct 24, 2026
Merged

zachdaniel merged 1 commit into
ash-project:mainfrom
pcapel:fix/uniq-list-aggregate-sort-cast

Conversation

@pcapel

@pcapel pcapel commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

This test shows a bug in ash_sql. The fix is in ash-project/ash_sql#277

A list aggregate with uniq? and a sort on its own field fails with 42P10 when the column is varchar. The existing uniq_aggregate_sort_test.exs tests use comments.title, which is text, so they don't hit it. This adds a label attribute to Comment with migration_types(label: {:varchar, 255}), a uniq_comment_labels aggregate on Post, and a test next to its text twin.

The new test fails on ash_sql main and passes with the fix. The other five tests in the file pass either way.

mix test.generate_migrations created the migration and snapshot for test_repo only. The PG18 run reported no changes, because use_builtin_uuidv7_function?/0 now defaults to false and both runs resolve to test_repo. That matches the other recent test migrations.

Contributor checklist

Leave anything that you believe does not apply unchecked.

  • I accept the AI Policy, or AI was not used in the creation of this PR.
  • Bug fixes include regression tests
  • Chores
  • Documentation changes
  • Features include unit/acceptance tests
  • Refactoring
  • Update dependencies

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@pcapel

pcapel commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Comparing the CI failures here with existing failures, the only new one is the regression test as expected pending ash-project/ash_sql#277 merging and releasing.

@pcapel
pcapel marked this pull request as ready for review October 23, 2026 15:59
@zachdaniel
zachdaniel merged commit e036df5 into ash-project:main Oct 24, 2026
121 of 126 checks passed
@zachdaniel

Copy link
Copy Markdown
Contributor

🚀 Thank you for your contribution! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants