You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by gr...@apache.org on 2020/08/19 01:10:22 UTC

[incubator-superset] branch master updated: refactor: remove slice level label_colors from dashboard init load (#10603)

This is an automated email from the ASF dual-hosted git repository.

graceguo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 3bc7919  refactor: remove slice level label_colors from dashboard init load (#10603)
3bc7919 is described below

commit 3bc79191c46cb2d403b817de601415f06d61829d
Author: Grace Guo <gr...@airbnb.com>
AuthorDate: Tue Aug 18 18:10:06 2020 -0700

    refactor: remove slice level label_colors from dashboard init load (#10603)
---
 superset/config.py     | 1 +
 superset/views/core.py | 7 +++++++
 2 files changed, 8 insertions(+)

diff --git a/superset/config.py b/superset/config.py
index b4803e8..a974f85 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 48cd458..cee8a61 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,