Skip to content

feat(explore): indicate when a filter is mirrored onto a partition column - #43870

Open
hughhhh wants to merge 1 commit into
hughhhh/pfm-5-editor-uifrom
hughhhh/pfm-6-explore-indicator
Open

feat(explore): indicate when a filter is mirrored onto a partition column#43870
hughhhh wants to merge 1 commit into
hughhhh/pfm-5-editor-uifrom
hughhhh/pfm-6-explore-indicator

Conversation

@hughhhh

@hughhhh hughhhh commented Sep 4, 2026

Copy link
Copy Markdown
Member

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_RANGE adhoc filter, so the time range and ordinary filters are the same chip — one indicator covers both cases from 1d. The path that actually renders is DndAdhocFilterOptionOptionWrapperOption; OptionControlLabel and the legacy AdhocFilterOption are wired too, so the glyph 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.

Naming. partitionColumn already exists on these components as the unrelated Presto latest_partition feature, so this is partitionMapping throughout to avoid two meanings of the same word one prop apart.

Also fixes a bug this 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 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 the event_time time-range chip with its tooltip open, and no glyph on the country dimension or SUM(revenue) metric.

TESTING INSTRUCTIONS

Automated: 821 backend and 837 frontend tests pass; tsc, ruff, ruff format and oxlint clean.

Manually, on top of a dataset configured per pfm-5 (mapping event_time → dt_epoch, active):

  1. Open a chart on that dataset with a time-range filter.
  2. The Filters chip 2026-07-01 ≤ event_time < 2026-08-01 carries a small green filter glyph; the country dimension and SUM(revenue) metric do not.
  3. Hover the glyph → "This filter is also applied to a partition column for faster queries. See 'View query' for the generated SQL."
  4. Open View query and confirm the dt_epoch predicates the tooltip is referring to.
  5. Set PARTITION_FILTER_MAPPING: False and reload: the Explore payload serializes partition_filter_mapping as null and 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_range shared control was wired blind — Explore models the time range as a TEMPORAL_RANGE adhoc 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 in 09-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

  • Has associated issue:
  • Required feature flags: PARTITION_FILTER_MAPPING
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

🤖 Generated with Claude Code

@bito-code-review

bito-code-review Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Bito Automatic Review Skipped - Branch Excluded

Bito didn't auto-review because the source or target branch is excluded from automatic reviews.
No action is needed if you didn't intend for the agent to review it. Otherwise, to manually trigger a review, type /review in a comment and save.
You can change the branch exclusion settings here, or contact your Bito workspace admin at evan@preset.io.

@netlify

netlify Bot commented Sep 4, 2026

Copy link
Copy Markdown

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 413e5c6
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a9b220f2fb8440008b4b776
😎 Deploy Preview https://deploy-preview-43870--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@sadpandajoe
sadpandajoe requested a review from eschutho September 4, 2026 17:27
@hughhhh
hughhhh changed the base branch from hughhhh/pfm-5-editor-ui to master September 4, 2026 19:22
@hughhhh
hughhhh changed the base branch from master to hughhhh/pfm-5-editor-ui September 4, 2026 19:23
@hughhhh
hughhhh force-pushed the hughhhh/pfm-6-explore-indicator branch from 949b0af to 413e5c6 Compare September 4, 2026 19:54
…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
hughhhh force-pushed the hughhhh/pfm-6-explore-indicator branch from 413e5c6 to 6142a9e Compare September 4, 2026 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant