mirror of https://github.com/apache/superset.git
Migrate filter_immune_slice_fields (#8718)
This commit is contained in:
parent
0ed0031412
commit
606ac3255d
|
@ -586,6 +586,7 @@ class Dashboard(Model, AuditMixinNullable, ImportMixin):
|
||||||
slices = copy(dashboard_to_import.slices)
|
slices = copy(dashboard_to_import.slices)
|
||||||
old_to_new_slc_id_dict = {}
|
old_to_new_slc_id_dict = {}
|
||||||
new_filter_immune_slices = []
|
new_filter_immune_slices = []
|
||||||
|
new_filter_immune_slice_fields = {}
|
||||||
new_timed_refresh_immune_slices = []
|
new_timed_refresh_immune_slices = []
|
||||||
new_expanded_slices = {}
|
new_expanded_slices = {}
|
||||||
i_params_dict = dashboard_to_import.params_dict
|
i_params_dict = dashboard_to_import.params_dict
|
||||||
|
@ -611,6 +612,13 @@ class Dashboard(Model, AuditMixinNullable, ImportMixin):
|
||||||
and old_slc_id_str in i_params_dict["filter_immune_slices"]
|
and old_slc_id_str in i_params_dict["filter_immune_slices"]
|
||||||
):
|
):
|
||||||
new_filter_immune_slices.append(new_slc_id_str)
|
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 (
|
if (
|
||||||
"timed_refresh_immune_slices" in i_params_dict
|
"timed_refresh_immune_slices" in i_params_dict
|
||||||
and old_slc_id_str in i_params_dict["timed_refresh_immune_slices"]
|
and old_slc_id_str in i_params_dict["timed_refresh_immune_slices"]
|
||||||
|
@ -647,6 +655,10 @@ class Dashboard(Model, AuditMixinNullable, ImportMixin):
|
||||||
dashboard_to_import.alter_params(
|
dashboard_to_import.alter_params(
|
||||||
filter_immune_slices=new_filter_immune_slices
|
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:
|
if new_timed_refresh_immune_slices:
|
||||||
dashboard_to_import.alter_params(
|
dashboard_to_import.alter_params(
|
||||||
timed_refresh_immune_slices=new_timed_refresh_immune_slices
|
timed_refresh_immune_slices=new_timed_refresh_immune_slices
|
||||||
|
|
Loading…
Reference in New Issue