diff --git a/superset/config.py b/superset/config.py index b4803e8c8d..a974f85ac1 100644 --- a/superset/config.py +++ b/superset/config.py @@ -304,6 +304,7 @@ DEFAULT_FEATURE_FLAGS: Dict[str, bool] = { # Exposes API endpoint to compute thumbnails "THUMBNAILS": False, "REDUCE_DASHBOARD_BOOTSTRAP_PAYLOAD": True, + "REMOVE_SLICE_LEVEL_LABEL_COLORS": False, "SHARE_QUERIES_VIA_KV_STORE": False, "SIP_38_VIZ_REARCHITECTURE": False, "TAGGING_SYSTEM": False, diff --git a/superset/views/core.py b/superset/views/core.py index 48cd4583d4..cee8a618c8 100755 --- a/superset/views/core.py +++ b/superset/views/core.py @@ -1652,6 +1652,13 @@ class Superset(BaseSupersetView): # pylint: disable=too-many-public-methods ) dashboard_data = dash.data + if is_feature_enabled("REMOVE_SLICE_LEVEL_LABEL_COLORS"): + # dashboard metadata has dashboard-level label_colors, + # so remove slice-level label_colors from its form_data + for slc in dashboard_data.get("slices"): + form_data = slc.get("form_data") + form_data.pop("label_colors", None) + dashboard_data.update( { "standalone_mode": standalone_mode,