From 08f07a2e92869efa34e5851feb7d47980997a27b Mon Sep 17 00:00:00 2001 From: Maxim Zudilov Date: Mon, 30 Oct 2017 18:00:04 +1300 Subject: [PATCH] Fix has_table method Dialect's has_table method requires connection as the first argument, not engine (https://github.com/zzzeek/sqlalchemy/blob/master/lib/sqlalchemy/engine/interfaces.py#L454). Instead, we can use engine's has_table method that handles the connection for us (https://github.com/zzzeek/sqlalchemy/blob/master/lib/sqlalchemy/engine/base.py#L2141). Alternatively, we could call engine.dialect.has_table(engine.connect(), ...). --- superset/models/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/superset/models/core.py b/superset/models/core.py index f481500b5df3..aa2484fdb48b 100644 --- a/superset/models/core.py +++ b/superset/models/core.py @@ -788,8 +788,8 @@ def get_perm(self): def has_table(self, table): engine = self.get_sqla_engine() - return engine.dialect.has_table( - engine, table.table_name, table.schema or None) + return engine.has_table( + table.table_name, table.schema or None) def get_dialect(self): sqla_url = url.make_url(self.sqlalchemy_uri_decrypted)