Skip to content

feat(compiler): aggregate fanned-out metric sources independently before combining - #249

Merged
mischuh merged 1 commit into
mainfrom
feat/compiler-fanout-aggregation
Jul 27, 2026
Merged

feat(compiler): aggregate fanned-out metric sources independently before combining#249
mischuh merged 1 commit into
mainfrom
feat/compiler-fanout-aggregation

Conversation

@mischuh

@mischuh mischuh commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Pre-aggregate each metric's source at its own grain as a CTE and combine via FULL JOIN/CROSS JOIN, instead of raising FanoutUnsafe, when additive metrics span sources joined by a non-one_to_one relationship
  • Keep FanoutUnsafe for non-additive/semi-additive cross-source fanout
  • Add coverage for multi-leaf grouping, unreachable-dimension, and non-additive-still-blocked cases

Test plan

  • pytest tests/compiler/test_simple_additive_multi_metric.py -v
  • pytest tests/ -x --tb=short (1985 passed)
  • ruff check . && ruff format --check .
  • mypy canonic/compiler/strategies/simple_additive.py

…ore combining

- Pre-aggregate each metric's source at its own grain as a CTE and combine
  via FULL JOIN/CROSS JOIN, instead of raising FanoutUnsafe, when additive
  metrics span sources joined by a non-one_to_one relationship
- Keep FanoutUnsafe for non-additive/semi-additive cross-source fanout
- Add coverage for multi-leaf grouping, unreachable-dimension, and
  non-additive-still-blocked cases
@mischuh mischuh self-assigned this Jul 27, 2026
@mischuh
mischuh merged commit 0cfa313 into main Jul 27, 2026
5 checks passed
@mischuh
mischuh deleted the feat/compiler-fanout-aggregation branch July 27, 2026 20:11
@mischuh mischuh mentioned this pull request Jul 27, 2026
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