Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: chart import #25425

Merged
merged 1 commit into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@

# 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):

Check warning on line 103 in superset/charts/commands/importers/v1/utils.py

View check run for this annotation

Codecov / codecov/patch

superset/charts/commands/importers/v1/utils.py#L103

Added line #L103 was not covered by tests
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
Loading