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