Skip to content

test: reproduce incorrect parent detection in nested aggregates - #1

Closed
jechol wants to merge 1 commit into
mainfrom
test/aggregate-parent-scope
Closed

jechol wants to merge 1 commit into
mainfrom
test/aggregate-parent-scope

Conversation

@jechol

@jechol jechol commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

The aggregate grouping check can mistake a parent reference inside a nested aggregate for an outer parent reference, causing can_group?/3 to reject grouping.

The test counts posts with comments meeting each post's min_score. The inner parent(min_score) refers to Post, so it should not prevent grouping the post count. This is similar to ash-project/ash#3105.

Adds a failing regression test only. The existing 21 tests in aggregate_test.exs pass.

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

@jechol jechol closed this Nov 4, 2026
@jechol
jechol deleted the test/aggregate-parent-scope branch November 4, 2026 04:18
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.

1 participant