dennisimoo opened a new pull request, #44188:
URL: https://github.com/apache/superset/pull/44188

   ### SUMMARY
   
   Preserve saved `color_scheme` and `row_limit` when a same-visualization, 
same-dataset MCP chart update omits them. The mappers materialize defaults, so 
a plain dictionary merge currently replaces saved values even when the caller 
only changes a metric.
   
   Related to #44176. This deliberately covers the two reported shared 
controls, using `model_fields_set` in the existing non-Gauge merge path. It 
does not introduce per-chart field maps or claim to resolve omission semantics 
for every mapper-specific control. Gauge behavior, visualization changes, and 
dataset rebinds remain unchanged.
   
   Explicitly supplied values still override saved values, including values 
equal to the schema defaults and `color_scheme=None` (the mapper's existing 
default-color reset behavior).
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Backend-only change. Reproduced with an existing Pie chart: changing the 
metric while omitting these controls changed `lyftColors / 42` to 
`supersetColors / 100` before the fix. The saved values are retained afterward.
   
   ### TESTING INSTRUCTIONS
   
   - The omitted-defaults regression failed on unmodified master; the other 
four explicit-update/reset cases passed.
   - `pytest -q tests/unit_tests/mcp_service/chart/test_chart_utils.py 
tests/unit_tests/mcp_service/chart/test_gauge_chart.py`: 289 passed (Python 
3.11, fastmcp extra installed).
   - `pre-commit run --files superset/mcp_service/chart/chart_utils.py 
tests/unit_tests/mcp_service/chart/test_chart_utils.py`: passed.
   - Direct pylint check of `chart_utils.py`: passed.
   
   To reproduce through Python, construct a `PieChartConfig` with only a 
dimension and metric, map it using `map_pie_config`, and merge it into existing 
form data with the same `viz_type`, `color_scheme="lyftColors"`, and 
`row_limit=42`. Both saved controls should remain. Explicitly setting them 
should still replace them.
   
   ### ADDITIONAL INFORMATION
   
   - [x] Has associated issue: #44176 (bounded partial fix)
   - [ ] Required feature flags
   - [ ] Changes UI
   - [ ] Includes DB Migration
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   AI disclosure: This patch, tests, and description were prepared and checked 
by OpenAI Codex at the account owner's explicit request. No independent human 
review is claimed.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to