superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From johnbod...@apache.org
Subject [incubator-superset] branch master updated: [get_df] Updating multi-statement logic (#5517)
Date Tue, 31 Jul 2018 21:52:08 GMT
This is an automated email from the ASF dual-hosted git repository.

johnbodley 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 e7d0512  [get_df] Updating multi-statement logic (#5517)
e7d0512 is described below

commit e7d05127d16231475ffdb22da9c784fd346d09cf
Author: John Bodley <4567245+john-bodley@users.noreply.github.com>
AuthorDate: Tue Jul 31 14:52:03 2018 -0700

    [get_df] Updating multi-statement logic (#5517)
---
 superset/models/core.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/superset/models/core.py b/superset/models/core.py
index 0070498..9264fcf 100644
--- a/superset/models/core.py
+++ b/superset/models/core.py
@@ -738,8 +738,12 @@ class Database(Model, AuditMixinNullable, ImportMixin):
 
         with closing(engine.raw_connection()) as conn:
             with closing(conn.cursor()) as cursor:
-                for sql in sqls:
+                for sql in sqls[:-1]:
                     self.db_engine_spec.execute(cursor, sql)
+                    cursor.fetchall()
+
+                self.db_engine_spec.execute(cursor, sqls[-1])
+
                 df = pd.DataFrame.from_records(
                     data=list(cursor.fetchall()),
                     columns=[col_desc[0] for col_desc in cursor.description],


Mime
View raw message