Skip to content

Commit

Permalink
fix: Ensure config is a dict in cross filters scope migration (#24661)
Browse files Browse the repository at this point in the history
  • Loading branch information
kgabryje committed Jul 11, 2023
1 parent bbffc4c commit 2e4d9f2
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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", {})

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2e4d9f2

Please sign in to comment.