You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by mi...@apache.org on 2023/10/19 13:06:12 UTC
[superset] 04/09: fix(import): Make sure query context is overwritten for overwriting imports (#25493)
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit af1e71352ae0ce607b9882ec2e607b43904d256f
Author: Jack Fragassi <jf...@gmail.com>
AuthorDate: Mon Oct 16 09:49:55 2023 -0700
fix(import): Make sure query context is overwritten for overwriting imports (#25493)
(cherry picked from commit a0a0d8043fe7004134bf89a05e6b5f6ee41399e5)
---
superset/charts/commands/importers/v1/__init__.py | 2 +-
superset/commands/importers/v1/assets.py | 2 +-
superset/dashboards/commands/importers/v1/__init__.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/superset/charts/commands/importers/v1/__init__.py b/superset/charts/commands/importers/v1/__init__.py
index 2a9c691159..043018fa3b 100644
--- a/superset/charts/commands/importers/v1/__init__.py
+++ b/superset/charts/commands/importers/v1/__init__.py
@@ -95,6 +95,6 @@ class ImportChartsCommand(ImportModelsCommand):
config["params"].update({"datasource": dataset.uid})
if "query_context" in config:
- del config["query_context"]
+ config["query_context"] = None
import_chart(session, config, overwrite=overwrite)
diff --git a/superset/commands/importers/v1/assets.py b/superset/commands/importers/v1/assets.py
index f0720d70b1..4c8971315c 100644
--- a/superset/commands/importers/v1/assets.py
+++ b/superset/commands/importers/v1/assets.py
@@ -117,7 +117,7 @@ class ImportAssetsCommand(BaseCommand):
dataset_uid = f"{dataset_dict['datasource_id']}__{dataset_dict['datasource_type']}"
config["params"].update({"datasource": dataset_uid})
if "query_context" in config:
- del config["query_context"]
+ config["query_context"] = None
chart = import_chart(session, config, overwrite=True)
chart_ids[str(chart.uuid)] = chart.id
diff --git a/superset/dashboards/commands/importers/v1/__init__.py b/superset/dashboards/commands/importers/v1/__init__.py
index e86bddec9f..30e63da4e4 100644
--- a/superset/dashboards/commands/importers/v1/__init__.py
+++ b/superset/dashboards/commands/importers/v1/__init__.py
@@ -118,7 +118,7 @@ class ImportDashboardsCommand(ImportModelsCommand):
dataset_uid = f"{dataset_dict['datasource_id']}__{dataset_dict['datasource_type']}"
config["params"].update({"datasource": dataset_uid})
if "query_context" in config:
- del config["query_context"]
+ config["query_context"] = None
chart = import_chart(session, config, overwrite=False)
chart_ids[str(chart.uuid)] = chart.id