fix: remove deprecated filter_scopes from import_dashboard script (#66)

Reference issue: https://github.com/overhangio/tutor-cairn/pull/53/files\#r2034772248
Filter_scopes have been deprecated as of Superset 4.0.0
We have also migrated away from filter box to native filters as of #53.
This commit is contained in:
Danyal Faheem 2025-04-10 11:09:53 +05:00 committed by GitHub
parent 0c033e2a9a
commit a4c4b6b158
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 14 deletions

View File

@ -0,0 +1 @@
- [Bugfix] Remove deprecated filter_scopes from import_dashboard script. (by @Danyal-Faheem)

View File

@ -229,20 +229,6 @@ def import_dashboard(data, user, database):
# Update filter mapping
metadata = json.loads(dashboard.json_metadata)
new_filter_scopes = {}
for old_slice_id, filter_scope in metadata["filter_scopes"].items():
new_filter_scope = {}
for filter_name, properties in filter_scope.items():
properties["immune"] = [
old_to_new_slice_id_map[old_immune_id]
for old_immune_id in properties["immune"]
]
new_filter_scope[filter_name] = properties
# Note that filter scope keys are str, not int
new_filter_scopes[
str(old_to_new_slice_id_map[int(old_slice_id)])
] = new_filter_scope
metadata["filter_scopes"] = new_filter_scopes
dashboard.json_metadata = json.dumps(metadata)
# Load dashboard