Repository navigation
Conversation
Code Review Agent Run #ac7f0fActionable Suggestions - 0Additional Suggestions - 1
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #44188 +/- ##
==========================================
+ Coverage 80.25% 80.27% +0.01%
==========================================
Files 2927 2927
Lines 173273 173276 +3
Branches 40173 40175 +2
==========================================
+ Hits 139060 139094 +34
+ Misses 31618 31578 -40
- Partials 2595 2604 +9
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:
|
|
Clarified the limited scope in e494e56. All 170 chart utility tests and pre-commit checks pass. The cancelled CI job had passed its tests; the new commit triggers a fresh run. |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Code Review Agent Run #96d568Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
gabotorresruiz
left a comment
There was a problem hiding this comment.
Thanks for this fix @dennisimoo, and welcome! The direction is exactly right and the tests are well constructed, but I verified on this branch that the preservation never triggers on the real update_chart / update_chart_preview paths because column normalization round-trips the config and marks every field as set before the merge runs. Details and two suggested fixes in the inline comment.
Separately, the Python CI jobs on this run look unrelated to your change (none of the failures touch mcp_service, and the alembic multiple-heads error matches a master-side CI issue that was fixed later the same day), so a rebase should clear them. We will need them green before merging either way.
e494e56 to
05c6a59
Compare
Code Review Agent Run #5f5484Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
gabotorresruiz
left a comment
There was a problem hiding this comment.
Thanks @dennisimoo, this addresses my change request. Verified on 05c6a59:
- All 13 registered plugins now dump with
model_dump(exclude_unset=True), somodel_fields_setsurvivesDatasetValidator.normalize_column_names. I swept every registered chart type on this head: minimal config, throughnormalize_column_nameswith a stubbedDatasetContext, mapped, then merged against a savedcolor_scheme="lyftColors"/row_limit=42. At my previous review SHAe494e56, 11 of the 13 lost at least one of the two saved values; on this head all 13 keep them. test_merge_chart_preserves_omitted_defaultsis the normalized path test I asked for, and it does fail ate494e56(supersetColors/100instead oflyftColors/42), so it pins the fix and not just the invariant.tests/unit_tests/mcp_service/chart/: 1638 passed, 1 skipped locally, matching your numbers. The revived"filters" not in fields_setgate is covered by the omitted/empty/null parametrization across all 13 plugins.- CI is green on this head.
Leaving the remaining presentation defaults to #44176 is the right call for this PR.
LGTM.
rusackas
left a comment
There was a problem hiding this comment.
Heya @dennisimoo, the exclude_unset=True fix is right, checked it against every plugin file this touches, the direct config_dict[key] indexing later in each one is always gated behind a .get(key) truthy check first, so dropping unset defaults from the dump can't introduce a KeyError. Good root cause too, gabotorresruiz's read on update_chart re-materializing all fields through the old model_dump() was exactly it.
Approving.
(cherry picked from commit cf10e89)
update_chart and update_chart_preview merge a config into the saved chart, but only filters, color_scheme and row_limit survive when the caller leaves them out. Every other field falls back to the mapper's default. Naming one field on a pie resets donut, labels, legend and sorting; a table config without viz_type turns an interactive table into a plain table, and an xy config without kind turns a bar chart into a line chart. Both of the latter count as a viz change, which throws away every saved control, filters included. Each chart plugin declares update_form_data_keys: the form_data keys each config field writes, with a dotted path into nested models such as legend and the axes. The default merge_update_form_data uses it key by key: a key that a named field writes takes the mapped value, or is dropped when the mapping no longer writes it; any other key keeps the saved value. When the saved chart has no value for a key, the mapped default stays, as apache#44188 intended for new controls. - resolve_update_config fills an omitted table viz_type, xy kind and big number trendline from the saved chart, so the update keeps its viz type. The fill runs before column normalization, which rebuilds the config from its set fields, so filled fields count as set; each holds the saved value and writes it back. - A viz change inside one chart type (xy kind, table viz_type, big number trendline) is an ordinary field update. Only a config of another chart type replaces the saved controls. - filters: null clears the saved filters on every chart type that uses the declared merge, keeping the time-range filter the mapper generates. Before, it cleared them only when the mapper generated one. - gauge, treemap_v2 and gantt keep their own merge_update_form_data. - A unit test fails when a config field is neither in its plugin's table nor exempt with a stated reason, and when a table names a field that does not exist. generate_chart does not change: it never merges. Co-Authored-By: Claude Opus 5.5 <[email protected]>
SUMMARY
Preserve saved
color_schemeandrow_limitwhen a same-visualization, same-dataset MCP chart update omits them. Explicit values, including defaults andcolor_scheme=None, still override saved values.Non-Gauge column normalizers use
model_dump(exclude_unset=True), matching Gauge, so normalization preserves omission information before both update tools merge form data. This also restores the existing omitted-filter check. Chart-specific presentation defaults remain outside this bounded fix for #44176.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Backend-only. After normalization, a Pie metric update previously reset saved
lyftColors / 42tosupersetColors / 100; it retains the saved values with this fix.TESTING INSTRUCTIONS
pytest -q tests/unit_tests/mcp_service/chart/: 1,638 passed, 1 skipped.ADDITIONAL INFORMATION
AI-assisted with Codex; reproduced and tested locally. No independent human review is claimed.