Skip to content

Commit

Permalink
fix: chart import (apache#25425)
Browse files Browse the repository at this point in the history
  • Loading branch information
betodealmeida committed Sep 27, 2023
1 parent 40ba3c2 commit a4d8f36
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions superset/charts/commands/importers/v1/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ def migrate_chart(config: dict[str, Any]) -> dict[str, Any]:

# also update `query_context`
try:
query_context = json.loads(output.get("query_context", "{}"))
except json.decoder.JSONDecodeError:
query_context = json.loads(output.get("query_context") or "{}")
except (json.decoder.JSONDecodeError, TypeError):
query_context = {}
if "form_data" in query_context:
query_context["form_data"] = output["params"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def test_migrate_chart_area() -> None:
"certified_by": None,
"certification_details": None,
"viz_type": "area",
"query_context": None,
"params": json.dumps(
{
"adhoc_filters": [],
Expand Down

0 comments on commit a4d8f36

Please sign in to comment.