You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/04/27 17:55:59 UTC

[GitHub] [superset] betodealmeida commented on a diff in pull request #19782: fix: chart import error with virtual dataset

betodealmeida commented on code in PR #19782:
URL: https://github.com/apache/superset/pull/19782#discussion_r860098606


##########
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",

Review Comment:
   I'm also not familiar with this part, so I created a chart from a virtual dataset and it has `datasource_type` set to `table`. Looking at the source code it seems that "view" here means a database `VIEW`, not a virtual dataset, and is only used by the DB engine spec to retrieve the list of views from a given database:
   
   https://github.com/apache/superset/blob/4a835a4299bbe90def232e376f919bc494b2d0a1/superset/db_engine_specs/base.py#L873-L879
   
   So I think this should be `table`, and we also need to fix this line:
   
   https://github.com/apache/superset/blob/4a835a4299bbe90def232e376f919bc494b2d0a1/superset/commands/importers/v1/examples.py#L141



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org