You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by vi...@apache.org on 2020/01/04 19:52:20 UTC
[incubator-superset] 19/22: Migrate filter_immune_slice_fields
(#8718)
This is an automated email from the ASF dual-hosted git repository.
villebro pushed a commit to branch 0.35
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
commit b7cc619142b76a64f7213776304ac7f4117dcb7d
Author: Beto Dealmeida <ro...@dealmeida.net>
AuthorDate: Tue Dec 3 10:26:54 2019 -0800
Migrate filter_immune_slice_fields (#8718)
---
superset/models/core.py | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/superset/models/core.py b/superset/models/core.py
index b919c1e..1601b7d 100755
--- a/superset/models/core.py
+++ b/superset/models/core.py
@@ -571,6 +571,7 @@ class Dashboard(Model, AuditMixinNullable, ImportMixin):
slices = copy(dashboard_to_import.slices)
old_to_new_slc_id_dict = {}
new_filter_immune_slices = []
+ new_filter_immune_slice_fields = {}
new_timed_refresh_immune_slices = []
new_expanded_slices = {}
i_params_dict = dashboard_to_import.params_dict
@@ -597,6 +598,13 @@ class Dashboard(Model, AuditMixinNullable, ImportMixin):
):
new_filter_immune_slices.append(new_slc_id_str)
if (
+ "filter_immune_slice_fields" in i_params_dict
+ and old_slc_id_str in i_params_dict["filter_immune_slice_fields"]
+ ):
+ new_filter_immune_slice_fields[new_slc_id_str] = i_params_dict[
+ "filter_immune_slice_fields"
+ ][old_slc_id_str]
+ if (
"timed_refresh_immune_slices" in i_params_dict
and old_slc_id_str in i_params_dict["timed_refresh_immune_slices"]
):
@@ -632,6 +640,10 @@ class Dashboard(Model, AuditMixinNullable, ImportMixin):
dashboard_to_import.alter_params(
filter_immune_slices=new_filter_immune_slices
)
+ if new_filter_immune_slice_fields:
+ dashboard_to_import.alter_params(
+ filter_immune_slice_fields=new_filter_immune_slice_fields
+ )
if new_timed_refresh_immune_slices:
dashboard_to_import.alter_params(
timed_refresh_immune_slices=new_timed_refresh_immune_slices