Repository navigation
fix(versioning): don't record save-path defaults as user changes - #45352
Merged
aminghadersohi merged 5 commits intoOct 19, 2026
Merged
Conversation
A dashboard created from Explore's Save modal has none of the metadata keys
its first full save fills in (refresh_frequency, label_colors, ...), so
version history listed every default as "Set '<key>'" beside the user's
real edits. A json_metadata key that goes from missing to exactly the value
the save path writes for it no longer produces a change record; moving it
to any other value, or away from its default later, still does.
Explore's Conditional Formatting control echoed its value back on mount, so
opening the Customize tab wrote [] into an untouched chart's form data
("Set 'conditional formatting'"). The control now reports formatters only
after the user adds, edits or removes one. Every renderer already treats a
missing value like [].
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
mikebridge
marked this pull request as ready for review
October 15, 2026 17:19
Contributor
CodeAnt PR Risk: Low Risk
Assessed commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #45352 +/- ##
=======================================
Coverage 83.57% 83.57%
=======================================
Files 3049 3049
Lines 199985 200001 +16
Branches 46650 46653 +3
=======================================
+ Hits 167133 167148 +15
- Misses 29610 29611 +1
Partials 3242 3242
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
aminghadersohi
left a comment
Contributor
There was a problem hiding this comment.
Please remove the private tracker references.
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
sadpandajoe
added a commit
that referenced
this pull request
Oct 22, 2026
…ntrols Resolve ConditionalFormattingControl.test.tsx: keep both sides' tests. Master's file-level FormattingPopover stub replaced the real popover the CRUD tests drive, so the stub is dropped and the add/remove test uses the real popover. Two prune tests no longer expect the mount-time onChange echo removed in #45352. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
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
TL;DR: Version history listed settings nobody touched as changes. A dashboard's first save showed about 10 "Set '…'" rows for default settings, and a chart save showed "Set 'conditional formatting'". This PR stops recording those, so a save lists only what the user actually changed.
Background: When a dashboard is saved, Superset fills in default values for metadata settings it doesn't have yet (
refresh_frequency: 0,label_colors: {}, and so on). A dashboard created from Explore's Save modal ("Add to dashboard → create new") has none of them until its first full save. In Explore, the Conditional Formatting control wrote[]into the chart's form data as soon as it appeared. Opening the Customize tab was enough.Problem: Version history compares the saved state before and after each save. It counted "setting missing → default value" as a user change:
The real changes got buried, and the history claimed the user "set" things they never touched.
What this changes:
Charts (
ConditionalFormattingControl): the control no longer echoes its value back when it mounts. It reports formatters only after the user adds, edits or removes one. Every renderer that readsconditional_formattingalready treats a missing value like[]:getColorFormattersand?./|| [];buildQueryreads it.Charts that already store
[]behave as before. This also fixes a case where the earlier mount echo could overwrite formatters hydrated into an already-mounted control, for example an in-place version restore. A test covers it.Dashboards (
superset/versioning/diff.py): when version history records a save, ajson_metadatakey that was missing before the save and is set to exactly the save path's own default is not recorded.chart_customization_config,color_scheme_domain,cross_filters_enabled,default_filters,expand_all_slices,expanded_slices,label_colors,native_filter_configuration,refresh_frequency,timed_refresh_immune_slices.saveDashboardRequest, theHYDRATE_DASHBOARDreducer, andDashboardDAO.set_dash_metadata.null→ anything (anullcross_filters_enabledmeans "disabled" in the UI).The match is type-strict, so
1is notTrue.Why not extend #43350: #43350 handles "accurate chart version changes". Explore sends evidence of what its own hydration normalized, and capture ignores those differences. That fix deliberately covers only existing-chart overwrites from Explore. It deliberately trusts only differences produced during hydration; any later write counts as a real change. It also explicitly leaves dashboards out of scope. Neither case here fits:
Fixing the source (the control) and adding a small, explicit defaults table for dashboards keeps #43350's safety rules intact.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
No screenshots; this changes which history rows are recorded, not how they look. Examples from the two QA repros:
Dashboard: created from Explore's Save modal, then Edit properties → change title, slug and description → Save.
Chart: Big Number, with name, Subtitle and Show Metric Name changed in one save.
TESTING INSTRUCTIONS
Automated:
The new tests cover:
null→ default, type strictness, and keys outside the table;[](fix(versioning): suppress automatic chart normalization changes #43350's rule is unchanged);[]);Manual, with
VERSION_HISTORYon (the default):ADDITIONAL INFORMATION
VERSION_HISTORY(on by default; affects which version-history rows are recorded)Notes:
superset/versioning/factory.py(_normalize_dashboard_json_metadata) still compares those defaults. Aligning it changes when version rows are written, so it's kept separate. It isn't reachable in the repros above, because those saves always record the chart add.