Skip to content

Refactor pre-aggregation planner into explicit stages - #294

Open
hussainsultan wants to merge 1 commit into
mainfrom
refactor-preagg-planner-stages
Open

Refactor pre-aggregation planner into explicit stages#294
hussainsultan wants to merge 1 commit into
mainfrom
refactor-preagg-planner-stages

Conversation

@hussainsultan

Copy link
Copy Markdown
Collaborator

Summary

  • move source-aware pre-aggregation out of the large SemanticAggregateOp method into a dedicated planner module
  • model eight explicit planning stages and four source-level substages with frozen, slotted attrs records
  • retain a single mutable attrs builder for incrementally assembled source products
  • add stage-contract and fan-out-safety tests plus an architecture decision record

Design

The existing entry point now delegates to PreAggregationPlanner. Each stage has an explicit input and output contract, while the declared stage_types tuple makes the pipeline order inspectable. The source pre-aggregation stage is further split into preparation, measure resolution, grain planning, and compilation.

Verification

  • 1,189 semantic tests passed; 1 skipped; 11 xfailed; 4 xpassed
  • 249 focused pre-aggregation and soundness tests passed
  • 5 new stage-contract tests passed
  • Ruff checks and git diff validation passed

@hussainsultan
hussainsultan marked this pull request as ready for review August 18, 2026 13:47
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