From 421dece829e77abfae5e2c0a54ab6908bd59522e Mon Sep 17 00:00:00 2001 From: Kamil Gabryjelski Date: Tue, 11 Jul 2023 15:26:42 +0200 Subject: [PATCH] fix: Ensure config is a dict in cross filters scope migration --- ...23-05-11_12-41_4ea966691069_cross_filter_global_scoping.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/superset/migrations/versions/2023-05-11_12-41_4ea966691069_cross_filter_global_scoping.py b/superset/migrations/versions/2023-05-11_12-41_4ea966691069_cross_filter_global_scoping.py index 0d16acb250a0f..76bcc932fd968 100644 --- a/superset/migrations/versions/2023-05-11_12-41_4ea966691069_cross_filter_global_scoping.py +++ b/superset/migrations/versions/2023-05-11_12-41_4ea966691069_cross_filter_global_scoping.py @@ -62,6 +62,8 @@ def upgrade(): json_metadata = json.loads(dashboard.json_metadata or "{}") new_chart_configuration = {} for config in json_metadata.get("chart_configuration", {}).values(): + if not isinstance(config, dict): + continue chart_id = int(config.get("id", 0)) scope = config.get("crossFilters", {}).get("scope", {}) @@ -105,6 +107,8 @@ def downgrade(): json_metadata = json.loads(dashboard.json_metadata) new_chart_configuration = {} for config in json_metadata.get("chart_configuration", {}).values(): + if not isinstance(config, dict): + continue chart_id = config.get("id") if chart_id is None: continue