Skip to content

Commit

Permalink
[hotfix/sqllab] setting up the connection in the try: block
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Apr 18, 2017
1 parent d3f55a0 commit 76042be
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions superset/sql_lab.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ def handle_error(msg):
session.commit()
logging.info("Set query to 'running'")

engine = database.get_sqla_engine(schema=query.schema)
conn = engine.raw_connection()
cursor = conn.cursor()
logging.info("Running query: \n{}".format(executed_sql))
try:
engine = database.get_sqla_engine(schema=query.schema)
conn = engine.raw_connection()
cursor = conn.cursor()
logging.info("Running query: \n{}".format(executed_sql))
logging.info(query.executed_sql)
cursor.execute(
query.executed_sql, **db_engine_spec.cursor_execute_kwargs)
Expand Down

0 comments on commit 76042be

Please sign in to comment.