superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maximebeauche...@apache.org
Subject [incubator-superset] branch master updated: Fix incorrect datasource_name in dashboard export (#7892)
Date Tue, 23 Jul 2019 05:31:53 GMT
This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 2221445  Fix incorrect datasource_name in dashboard export (#7892)
2221445 is described below

commit 2221445f442cacfdfef8186496a5706be09f11ae
Author: Maxim Sukharev <max@smacker.ru>
AuthorDate: Tue Jul 23 07:31:47 2019 +0200

    Fix incorrect datasource_name in dashboard export (#7892)
    
    The bug was introduced in #7773
    
    It uses filter by `cls.table_name == datasource_name`:
    https://github.com/apache/incubator-superset/pull/7773/files#diff-a8dd5ec8d8decda2e3c5571d1ec0cdb6R740
    
    But export puts `slc.datasource.name` into exported json:
    https://github.com/apache/incubator-superset/pull/7773/files#diff-ceeb7eee8d573333109e0037299c9711L673
    
    `slc.datasource.name` in case of `SqlaTable` is `"{}.{}".format(self.schema, self.table_name)`
---
 superset/models/core.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/superset/models/core.py b/superset/models/core.py
index bfc080b..cb80611 100755
--- a/superset/models/core.py
+++ b/superset/models/core.py
@@ -678,7 +678,7 @@ class Dashboard(Model, AuditMixinNullable, ImportMixin):
                 # add extra params for the import
                 copied_slc.alter_params(
                     remote_id=slc.id,
-                    datasource_name=slc.datasource.name,
+                    datasource_name=slc.datasource.datasource_name,
                     schema=slc.datasource.schema,
                     database_name=slc.datasource.database.name,
                 )


Mime
View raw message