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)`
This commit is contained in:
Maxim Sukharev
2019-07-23 07:31:47 +02:00
committed by Maxime Beauchemin
parent 648f9fa54b
commit 2221445f44

View File

@@ -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,
)