feat(explore): indicate when a filter is mirrored onto a partition column - #43870
Open
hughhhh wants to merge 1 commit into
Open
feat(explore): indicate when a filter is mirrored onto a partition column#43870hughhhh wants to merge 1 commit into
hughhhh wants to merge 1 commit into
Conversation
Contributor
|
Bito Automatic Review Skipped - Branch Excluded |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
hughhhh
requested review from
michael-s-molina,
rusackas,
sadpandajoe and
villebro
as code owners
September 4, 2026 19:22
hughhhh
force-pushed
the
hughhhh/pfm-6-explore-indicator
branch
from
September 4, 2026 19:54
949b0af to
413e5c6
Compare
…lumn Sixth and last of the stack, implementing wireframe 1d. A chart author configures none of this and ideally never learns the word "partition"; the glyph exists only to explain why their query got faster and to point at the generated SQL where the extra predicate is visible. The indicator renders on any filter whose column the dataset maps, which covers the time range too -- Explore models it as a TEMPORAL_RANGE adhoc filter, so it is the same chip. `DndAdhocFilterOption` -> `OptionWrapper` -> `Option` is the path that actually renders in Explore; `OptionControlLabel` and the legacy `AdhocFilterOption` are wired as well so the indicator does not silently vanish on whichever surface uses them. The standalone `time_range` control gets the mapping through a new `mapStateToProps`, for viz types that still have one. `partitionColumn` already exists on these components as the unrelated Presto `latest_partition` feature, so this is `partitionMapping` throughout. Also fixes a bug the indicator made visible: `partition_filter_mapping_summary` was not gated on the feature flag, so with `PARTITION_FILTER_MAPPING` off the payload still reported `active: true`. Nothing is mirrored in that state -- `resolve_partition_mapping` returns None -- so the glyph was promising a predicate the query never carried. The summary now gates the same way the query path does. It was invisible until something rendered from it. Verified in Explore against a real partitioned table: the glyph appears on the `event_time` time-range chip and on nothing else, the tooltip reads "This filter is also applied to a partition column for faster queries", and with the flag off the mapping serializes as null and no glyph renders. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
hughhhh
force-pushed
the
hughhhh/pfm-6-explore-indicator
branch
from
September 4, 2026 21:03
413e5c6 to
6142a9e
Compare
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
Sixth and last of the partition filter mapping stack, implementing wireframe 1d — the piece that tells a chart author why their query got faster.
Stacked on
hughhhh/pfm-5-editor-ui(#43891). Review the compare against pfm-5 rather than the diff against master.A small glyph appears on any filter whose column the dataset mirrors onto its partition column, with the tooltip "This filter is also applied to a partition column for faster queries. See 'View query' for the generated SQL." Chart authors configure nothing and ideally never learn the word "partition"; per the PRD the indicator exists only to explain the speed-up and point at the SQL.
Where it renders. Explore models the time range as a
TEMPORAL_RANGEadhoc filter, so the time range and ordinary filters are the same chip — one indicator covers both cases from 1d. The path that actually renders isDndAdhocFilterOption→OptionWrapper→Option;OptionControlLabeland the legacyAdhocFilterOptionare wired too, so the glyph does not silently vanish on whichever surface uses them. The standalonetime_rangecontrol gets the mapping through a newmapStateToProps, for viz types that still have one.Naming.
partitionColumnalready exists on these components as the unrelated Prestolatest_partitionfeature, so this ispartitionMappingthroughout to avoid two meanings of the same word one prop apart.Also fixes a bug this made visible.
partition_filter_mapping_summarywas not gated on the feature flag, so withPARTITION_FILTER_MAPPINGoff the payload still reportedactive: true. Nothing is mirrored in that state —resolve_partition_mappingreturnsNone— so the indicator was promising a predicate the query never carried. The summary now gates the same way the query path does. The bug has been in the stack since pfm-1; it was invisible until something rendered from it, which is exactly what this PR does.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Attaching separately:
08-1d-explore-indicator.png— the glyph on theevent_timetime-range chip with its tooltip open, and no glyph on thecountrydimension orSUM(revenue)metric.TESTING INSTRUCTIONS
Automated: 821 backend and 837 frontend tests pass;
tsc,ruff,ruff formatandoxlintclean.Manually, on top of a dataset configured per pfm-5 (mapping
event_time → dt_epoch, active):2026-07-01 ≤ event_time < 2026-08-01carries a small green filter glyph; thecountrydimension andSUM(revenue)metric do not.dt_epochpredicates the tooltip is referring to.PARTITION_FILTER_MAPPING: Falseand reload: the Explore payload serializespartition_filter_mappingasnulland no glyph renders.Verified end-to-end against a real partitioned Postgres table in Docker, including the flag-off case.
Also verified: the standalone Time Range control
The
time_rangeshared control was wired blind — Explore models the time range as aTEMPORAL_RANGEadhoc filter, so the chip path is what renders for most viz types and the standalone control never appeared during the first pass. Checked on a viz type that still declares one (cal_heatmap, whose control panel is[['granularity_sqla'], ['time_range']]): the Time Range pill carries the glyph and the tooltip opens, alongside a rendering chart. Captured in09-1d-standalone-time-range-control.png.That closes both surfaces the PR touches — the adhoc filter chip and the standalone control.
Deviation from the mockup
1d shows the tooltip ending in a clickable View generated SQL → link. This ships as static text pointing at View query instead: the tooltip hangs off a small hover glyph, so reaching a link inside it means traversing from the icon without dismissing the tooltip, and the View query action lives in the chart's
⋯menu rather than anywhere the control panel can reach without new plumbing. Happy to add the link if the interaction is worth the wiring.ADDITIONAL INFORMATION
PARTITION_FILTER_MAPPING🤖 Generated with Claude Code