Conversation
✅ Deploy Preview for thriving-cassata-78ae72 canceled.
|
|
| and decomposition.params | ||
| ): | ||
| for component in components: | ||
| component.params = dict(reaggregate.params) | ||
| # The implementation knows its effective defaults and may | ||
| # normalize equivalent spellings (e.g. omitted compression | ||
| # and an explicit default). Store those effective parameters | ||
| # so identical sketches have the same measure identity. | ||
| component.params = dict(decomposition.params) |
There was a problem hiding this comment.
Existing sketch measures cannot be reused
If a metric with omitted sketch parameters already has a frozen measure, that measure was stored without parameters. This change extracts the same named component with effective parameters such as {"compression": 1}. Frozen-measure reuse compares those parameters and rejects the mismatch, so redeploying the metric fails instead of reusing its measure. Existing measures need a compatibility or migration path.
There was a problem hiding this comment.
Good catch. Updated in b4c10c4: the family canonicalizes an explicit default to the legacy empty parameter map, rather than adding a default parameter to formerly unparameterized measures. The extractor only persists nonempty canonical parameters, so both omitted and explicit defaults retain params=None and reuse existing frozen measures. The regression test now asserts that identity for omitted, integer, and integer-valued-float defaults.
AI ReviewSummaryThe PR makes equivalent sketch declarations share a newly extracted component identity and preserves reuse of legacy omitted-default rows. It does not preserve reuse of rows previously stored with an explicit default, so existing metrics can fail on redeployment. Findings
Tests
Missing context / blind spots
Final Verdict
Reviewed commit |
There was a problem hiding this comment.
DataJunction deep review of b4c10c475dc26fe2af9150d5c11562e7bba136e1. Maintained summary includes off-diff findings. Advisory only.
| and reaggregate is not None | ||
| and dj_function in family.aggregate_functions | ||
| and reaggregate.params | ||
| and decomposition.params |
There was a problem hiding this comment.
A frozen measure created before this change with an explicit default retains its parameter map: for the registered test family, {"compression": 1}. Extracting the unchanged metric now strips that default and leaves component.params=None, while keeping the same component name and aggregation. Both individual and bulk derivation look up the existing row by name, then _raise_if_frozen_measure_conflicts rejects the unequal parameter maps. Redeploying that metric therefore fails. The prior discussion's fix covers rows created with an omitted default, not rows created with an explicit one.
Provide an upgrade-safe equivalence check or migrate those stored rows before reuse. Stored preaggregations also retain parameter-bearing measure identity tokens, so account for their matching behavior. Add a regression starting from a pre-upgrade explicit-default row and exercising frozen-measure derivation.
Problem
A t-digest metric that omits compression uses the default value of 200. Another metric can explicitly set compression to 200. Both generate the same sketch and the same component name.
Today, the first component is recorded with no parameters, while the second is recorded with compression=200. When the second metric tries to reuse the existing frozen measure, OSS rejects it because the recorded parameters differ.
Change
Let a registered family decomposition canonicalize parameters before OSS records them on a component. The t-digest implementation can treat an explicit default of 200 as no stored parameter, so it matches the existing sketch. A non-default value such as 500 remains distinct.
Metrics that already use an omitted default keep their existing empty-parameter identity.
Tests
The new regression test checks that omitted, integer, and integer-valued-float defaults produce the same component name and parameter identity. Local checks: 12 family-decomposition tests and 51 frozen-measure/preaggregation tests passed.