fix: import dashboard stale filter_scopes (#17741)

This commit is contained in:
Beto Dealmeida 2021-12-14 07:23:55 -08:00 committed by GitHub
parent e2e79923d3
commit 2633bcccc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -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
}
)

View File

@ -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": [],
}