Skip to content

fix: preserve parent scope in nested aggregate filters - #2

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

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

Conversation

@jechol

@jechol jechol commented Nov 4, 2026

Copy link
Copy Markdown
Owner

can_group?/3 can mistake parent references inside nested aggregate filters for outer dependencies, preventing aggregate grouping.

Track aggregate and exists scopes while traversing expression nodes, following Ash's implementation. This makes the regression from ash-project#279 pass. Filters referring to the aggregate's source still prevent grouping.

Validation: 45 aggregate/query/join tests pass with the locked Ash 3.37.2; formatting and Credo checks 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 6, 2026
@jechol
jechol deleted the fix/nested-aggregate-parent-scope branch November 6, 2026 01:02
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