From fea39aa4757f0d04c57f856f96ee2527987925b2 Mon Sep 17 00:00:00 2001 From: Smart-Codi Date: Fri, 29 Apr 2022 14:40:22 -0400 Subject: [PATCH] fix: chart import error with virtual dataset (#19782) * fix: chart import error with virtual dataset * remove unnecessary comment * resolve comment --- superset/charts/commands/importers/v1/__init__.py | 4 +--- superset/commands/importers/v1/examples.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/superset/charts/commands/importers/v1/__init__.py b/superset/charts/commands/importers/v1/__init__.py index f407a4662c47..ab88038aaabe 100644 --- a/superset/charts/commands/importers/v1/__init__.py +++ b/superset/charts/commands/importers/v1/__init__.py @@ -89,9 +89,7 @@ def _import( config.update( { "datasource_id": dataset.id, - "datasource_type": "view" - if dataset.is_sqllab_view - else "table", + "datasource_type": "table", "datasource_name": dataset.table_name, } ) diff --git a/superset/commands/importers/v1/examples.py b/superset/commands/importers/v1/examples.py index 43d7e7e1fa26..679b9c441beb 100644 --- a/superset/commands/importers/v1/examples.py +++ b/superset/commands/importers/v1/examples.py @@ -138,7 +138,7 @@ def _import( # pylint: disable=arguments-differ, too-many-locals, too-many-bran dataset_info[str(dataset.uuid)] = { "datasource_id": dataset.id, - "datasource_type": "view" if dataset.is_sqllab_view else "table", + "datasource_type": "table", "datasource_name": dataset.table_name, }