mirror of
https://github.com/apache/superset.git
synced 2024-09-12 16:49:40 -04:00
[get_df] Updating multi-statement logic (#5517)
This commit is contained in:
parent
8c822f1e9b
commit
e7d05127d1
@ -738,8 +738,12 @@ class Database(Model, AuditMixinNullable, ImportMixin):
|
|||||||
|
|
||||||
with closing(engine.raw_connection()) as conn:
|
with closing(engine.raw_connection()) as conn:
|
||||||
with closing(conn.cursor()) as cursor:
|
with closing(conn.cursor()) as cursor:
|
||||||
for sql in sqls:
|
for sql in sqls[:-1]:
|
||||||
self.db_engine_spec.execute(cursor, sql)
|
self.db_engine_spec.execute(cursor, sql)
|
||||||
|
cursor.fetchall()
|
||||||
|
|
||||||
|
self.db_engine_spec.execute(cursor, sqls[-1])
|
||||||
|
|
||||||
df = pd.DataFrame.from_records(
|
df = pd.DataFrame.from_records(
|
||||||
data=list(cursor.fetchall()),
|
data=list(cursor.fetchall()),
|
||||||
columns=[col_desc[0] for col_desc in cursor.description],
|
columns=[col_desc[0] for col_desc in cursor.description],
|
||||||
|
Loading…
Reference in New Issue
Block a user