Strip sql and remove ; for csv download. (#1508)

This commit is contained in:
Bogdan 2016-11-01 15:03:42 -07:00 committed by GitHub
parent 52380534f3
commit 769fb0820f
1 changed files with 1 additions and 0 deletions

View File

@ -697,6 +697,7 @@ class Database(Model, AuditMixinNullable):
return self.get_sqla_engine().dialect.identifier_preparer.quote
def get_df(self, sql, schema):
sql = sql.strip().strip(';')
eng = self.get_sqla_engine(schema=schema)
cur = eng.execute(sql, schema=schema)
cols = [col[0] for col in cur.cursor.description]