This repository was archived by the owner on Sep 1, 2026. It is now read-only.
Repository navigation
feat: record ranking/measure-value filter dimensions in visualizations_references - #48
Merged
Merged
Conversation
…s_references
The extractor read only the measure a rankingFilter/measureValueFilter ranks
*by*, never the dimension it ranks *over*. That dimension appeared in no table:
visualizations_filters keeps the operator, N and strictness but leaves
display_form_id empty. So a dimension unreachable from the measure's fact — which
fails the visualization outright ("Aggregation dimension ... is not comparable to
the dimensionality ... of the subtree") — was invisible to every offline check.
Accepts both spellings (`attributes` in stored content, `dimensionality` in AFM)
and both entry shapes: a bucket handle resolves like any other localIdentifier
target, incl. the {source}_invalid dangling flag; a direct label emits a row with
local_identifier NULL. The direct-label form is the one nothing else recorded.
v_objects_not_comparable's slice CTE is widened to match. The existing
object_type = 'label' predicate admits only dimensions, keeping the filters'
measure rows (metric) and dangling handles ({source}_invalid) out.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Problem
process_visualizations_referencesrecorded the measure arankingFilter/measureValueFilterranks by, but never the dimension it ranks over. That dimension appeared in no table at all —visualizations_filtersstores the operator, N and strictness, but leavesdisplay_form_idempty.A ranking dimension carries the same join-reachability requirement as an axis attribute: one the measure's fact cannot reach fails the visualization outright.
Because nothing recorded it,
v_objects_not_comparablecould not see it. A consuming workspace shipped 8 insights in exactly this state — a benchmark dimension ranked by a non-benchmark label, and one the other way round — behind a green check.Changes
Extraction — both spellings are read (
attributesin stored insight content,dimensionalityin the AFM API; both occur in the wild) and both entry shapes:local_identifierNULL, keeping the payload's type verbatim — anAfmObjectIdentifierhere is legally alabelor anattribute;Handles resolve against attribute-only lookups. Validating them against the shared bucket maps (which also hold measures) would let a dimension naming a measure handle be recorded as a valid metric reference instead of flagged.
Validity — a dangling dimension handle gets its own
object_type({filter}_dimension_invalid), distinct from the{filter}_invalidof a missing measure handle, since both break rendering but the fixes differ. Wired intovisualizations_is_validandv_visualizations_invalid_filters, which gains aninvalid_targetcolumn.v_objects_not_comparable— three corrections, each guarding a distinct failure:object_type = 'label'alone relaxed — it would have dropped everyattribute-typed dimension, half the shape this exists to catch.visualizations_filters, and only when the visualization has exactly one filter of that type; an ambiguous handle drops the row, erring toward a false negative as this view does elsewhere.De-duplication lives in the view rather than the extractor on purpose: dropping a real reference to suit one consumer would cost every other consumer the inventory.
Behaviour change
A visualization whose ranking filter names a missing dimension handle now flips
is_validto 0 in local mode, where it previously stayed 1. Called out under### Changedin the CHANGELOG.Verification
measureValueFilter) and a newtests/test_objects_not_comparable_view.pyrunning the real view SQL on an in-memory fixture — covering measure scoping, the Revenue/Cost sibling case, both duplication paths, and the ambiguous-filter drop.🤖 Generated with Claude Code