Skip to content

Commit

Permalink
fix(dashboard): import handle missing excluded charts (#19088)
Browse files Browse the repository at this point in the history
(cherry picked from commit 999c2c6)
  • Loading branch information
villebro committed Apr 3, 2022
1 parent 2193e17 commit 36561b7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion superset/dashboards/commands/importers/v1/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def update_id_refs( # pylint: disable=too-many-locals
scope_excluded = native_filter.get("scope", {}).get("excluded", [])
if scope_excluded:
native_filter["scope"]["excluded"] = [
id_map[old_id] for old_id in scope_excluded
id_map[old_id] for old_id in scope_excluded if old_id in id_map
]

return fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def test_update_native_filter_config_scope_excluded(app_context: None):
},
},
"metadata": {
"native_filter_configuration": [{"scope": {"excluded": [101, 102]}}],
"native_filter_configuration": [{"scope": {"excluded": [101, 102, 103]}}],
},
}
chart_ids = {"uuid1": 1, "uuid2": 2}
Expand Down

0 comments on commit 36561b7

Please sign in to comment.