Add scoped full recalculation to Impulse reporting - #95
Open
tombonfert wants to merge 6 commits into
Open
Conversation
- Introduce `FullRecalculation` config section naming aggregations, events, and calculated channels to recompute over all containers on the next incremental run, regardless of definition-hash changes. - Wire the override into `split_by_hash_change` so listed entities are promoted to the changed bucket and fully replace their gold rows. - Validate configured names against registered entities in `Report.determine_report` to fail fast on typos or stale names. - Add integration and unit tests covering config parsing, validation, and end-to-end scoped recalculation behavior.
Move `full_recalc_names`, `registered_names_by_kind`, and `validate_full_recalculation_scope` from private `Report` methods to `report_utils.py` so they can be reused and unit-tested independently. Update `Report` to delegate to the shared utilities while preserving the existing fail-fast validation and per-kind force-recalc behavior.
Remove the explicit `kinds` parameter from `validate_full_recalculation_scope` and iterate over the keys of `registered_names` instead. Update the single caller in `Report` to match, simplifying the API and ensuring validated kinds stay in sync with the entities actually registered for a report.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #95 +/- ##
==========================================
+ Coverage 89.50% 89.60% +0.09%
==========================================
Files 62 62
Lines 5591 5625 +34
Branches 686 694 +8
==========================================
+ Hits 5004 5040 +36
+ Misses 466 464 -2
Partials 121 121
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
- Use the config field names (`events`, `aggregations`, `calculated_channels`) as the kind keys passed to `full_recalc_names` and `validate_full_recalculation_scope`, replacing the old singular aliases and the internal `by_kind` mapping. - Pass registered entity lists directly into validation and derive names there with `get_name()`, removing the `registered_names_by_kind` helper.
…ental recalculation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
What
Adds an optional
full_recalculationconfig that names aggregations, events, and/or calculated channels to fully recompute on the next incremental run, regardless of whether their definition hash changed. Listed entities recompute over all containers and fully replace their gold rows, while everything else stays incremental.Why
Previously there was no way to force a full recompute of a specific entity whose definition was unchanged (for example, to backfill after a persistence fix or corrected upstream data). The only options were a full-mode run (recomputes everything, expensive) or artificially changing the definition.
How
The feature hooks into the existing changed/unchanged grouping.
split_by_hash_changegained aforce_recalc_namesargument that promotes hash-unchanged items into the "changed" bucket, reusing the entire existing changed-path machinery (all-container solve plus delete-by-source pruning). No persistence-layer changes were needed. It is a no-op in full mode, where everything already recomputes.Changes
config/config_parser.py: newFullRecalculationmodel and optionalfull_recalculationfield onImpulseConfig.core/report_utils.py:force_recalc_namesparam onsplit_by_hash_change, plusfull_recalc_names,registered_names_by_kind, andvalidate_full_recalculation_scopehelpers.core/report.py: wires the config scope into the three grouping call sites and validates the scope at the start ofdetermine_report(raises on names that match no registered entity).Tests
split_by_hash_change, config parsing, and fail-fast validation on unknown names.Test Plan
Checklist