sadpandajoe commented on code in PR #42910:
URL: https://github.com/apache/superset/pull/42910#discussion_r4402649226


##########
superset/mcp_service/chart/chart_utils.py:
##########
@@ -3822,6 +3829,9 @@ def merge_bullet_form_data(
         "marker_labels",
         "marker_lines",
         "marker_line_labels",
+        # Explore-only per-band colors; the typed config does not model them,
+        # so keep them as opaque saved state across MCP updates.
+        "range_colors",

Review Comment:
   Preserving `range_colors` here without tying it to `ranges` means a 
ranges-only `update_chart` keeps the old colors, and they get re-applied by 
position to the new thresholds. `merge_bullet_form_data` already clears 
`range_labels` for exactly this reason (`dependent_controls`, a few lines 
down), but `range_colors` isn't in that map.
   
   Example: a chart saved with `ranges="50,100"` and 
`range_colors=["#ff0000","#00ff00"]`, then updated with `ranges="100,200,300"`: 
the labels are reset, but the 100 band renders red and the 200 band green in 
both Explore and the MCP preview, and that gets saved.
   
   Should `ranges` replaced without `range_colors` also reset `range_colors` to 
`[]`?



-- 
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