Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 25E02200D53 for ; Tue, 31 Oct 2017 05:04:28 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 2477C160BE4; Tue, 31 Oct 2017 04:04:28 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6C271160BF8 for ; Tue, 31 Oct 2017 05:04:27 +0100 (CET) Received: (qmail 67940 invoked by uid 500); 31 Oct 2017 04:04:26 -0000 Mailing-List: contact commits-help@superset.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@superset.incubator.apache.org Delivered-To: mailing list commits@superset.incubator.apache.org Received: (qmail 67827 invoked by uid 99); 31 Oct 2017 04:04:26 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Oct 2017 04:04:26 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id D452781663; Tue, 31 Oct 2017 04:04:25 +0000 (UTC) Date: Tue, 31 Oct 2017 04:04:25 +0000 To: "commits@superset.apache.org" Subject: [incubator-superset] branch master updated: Fix has_table method (#3741) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <150942266573.16036.1290489174960143599@gitbox.apache.org> From: maximebeauchemin@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: incubator-superset X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 814b70ffd87750c8416d0f541504d8a854e82ec1 X-Git-Newrev: 5bc734b2e5ec4e15653f68a99d831f6a991adacf X-Git-Rev: 5bc734b2e5ec4e15653f68a99d831f6a991adacf X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated archived-at: Tue, 31 Oct 2017 04:04:28 -0000 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 5bc734b Fix has_table method (#3741) 5bc734b is described below commit 5bc734b2e5ec4e15653f68a99d831f6a991adacf Author: mxmzdlv AuthorDate: Tue Oct 31 17:04:23 2017 +1300 Fix has_table method (#3741) 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 f481500..aa2484f 100644 --- a/superset/models/core.py +++ b/superset/models/core.py @@ -788,8 +788,8 @@ class Database(Model, AuditMixinNullable): 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) -- To stop receiving notification emails like this one, please contact ['"commits@superset.apache.org" '].