Copilot commented on code in PR #40804:
URL: https://github.com/apache/superset/pull/40804#discussion_r3369799507


##########
superset/migrations/versions/2026-03-02_00-00_ce6bd21901ab_migrate_deckgl_and_mapbox.py:
##########
@@ -61,6 +61,22 @@
 ]
 
 
+def _is_mapbox_style(style: Any) -> bool:
+    return isinstance(style, str) and style.startswith("mapbox://")
+
+
+def _copy_legacy_maplibre_style(data: dict[str, Any]) -> bool:
+    mapbox_style = data.get("mapbox_style")
+    if (
+        isinstance(mapbox_style, str)
+        and not _is_mapbox_style(mapbox_style)
+        and "maplibre_style" not in data
+    ):
+        data["maplibre_style"] = mapbox_style
+        return True

Review Comment:
   When copying a legacy non-`mapbox://` `mapbox_style` into `maplibre_style`, 
the migration does not persist `map_renderer='maplibre'`. In Explore, missing 
control values are filled from the control `default`, so deployments with 
`DEFAULT_MAP_RENDERER=mapbox` + a Mapbox key can end up opening these migrated 
charts with Mapbox selected, undermining the intent to keep non-Mapbox/OSM 
styles on the MapLibre path and potentially breaking raster tile templates.
   
   Consider also setting `map_renderer` to `'maplibre'` when (and only when) 
you copy a legacy style and `map_renderer` is absent, so existing charts remain 
pinned to MapLibre regardless of deployment defaults.



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