Skip to content

Commit

Permalink
refactor: remove slice level label_colors from dashboard init load (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Grace Guo authored Aug 19, 2020
1 parent a3ac506 commit 3bc7919
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions superset/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ def _try_json_readsha( # pylint: disable=unused-argument
# 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,
Expand Down
7 changes: 7 additions & 0 deletions superset/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1652,6 +1652,13 @@ def dashboard(**_: Any) -> None:
)

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,
Expand Down

0 comments on commit 3bc7919

Please sign in to comment.