Skip to content

fix: correct test expectation for first aggregate with include_nil?#683

Merged
zachdaniel merged 1 commit intomainfrom
fix-first-aggregate-include-nil
Feb 4, 2026
Merged

fix: correct test expectation for first aggregate with include_nil?#683
zachdaniel merged 1 commit intomainfrom
fix-first-aggregate-include-nil

Conversation

@sevenseacat
Copy link
Contributor

@sevenseacat sevenseacat commented Feb 4, 2026

The test was asserting buggy behavior. With sort(title: :asc_nils_first) and include_nil?: true, the first aggregate should return nil when the first sorted record has a nil value, not skip to the next non-nil value.

The fix to make this updated test actually pass is in ash_sql here - ash-project/ash_sql#210

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

The test was asserting buggy behavior. With `sort(title: :asc_nils_first)`
and `include_nil?: true`, the `first` aggregate should return `nil` when the
first sorted record has a nil value, not skip to the next non-nil value.
@zachdaniel zachdaniel merged commit 960d4f4 into main Feb 4, 2026
65 of 67 checks passed
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