mirror of
https://github.com/apache/superset.git
synced 2026-06-04 15:19:25 +00:00
fix: import dashboard stale filter_scopes (#17741)
This commit is contained in:
@@ -84,6 +84,7 @@ def update_id_refs( # pylint: disable=too-many-locals
|
||||
metadata["filter_scopes"] = {
|
||||
str(id_map[int(old_id)]): columns
|
||||
for old_id, columns in metadata["filter_scopes"].items()
|
||||
if int(old_id) in id_map
|
||||
}
|
||||
|
||||
# now update columns to use new IDs:
|
||||
@@ -107,6 +108,7 @@ def update_id_refs( # pylint: disable=too-many-locals
|
||||
{
|
||||
str(id_map[int(old_id)]): value
|
||||
for old_id, value in default_filters.items()
|
||||
if int(old_id) in id_map
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -45,7 +45,10 @@ def test_update_id_refs_immune_missing( # pylint: disable=invalid-name
|
||||
},
|
||||
},
|
||||
"metadata": {
|
||||
"filter_scopes": {"101": {"filter_name": {"immune": [102, 103],},},},
|
||||
"filter_scopes": {
|
||||
"101": {"filter_name": {"immune": [102, 103]}},
|
||||
"104": {"filter_name": {"immune": [102, 103]}},
|
||||
},
|
||||
},
|
||||
"native_filter_configuration": [],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user