Skip to content

Commit

Permalink
fix: import dashboard stale filter_scopes
Browse files Browse the repository at this point in the history
  • Loading branch information
betodealmeida committed Dec 14, 2021
1 parent fceabf6 commit 12b0e15
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions superset/dashboards/commands/importers/v1/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
}
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": [],
}
Expand Down

0 comments on commit 12b0e15

Please sign in to comment.