Merge pull request #1029 from getredash/fixes_160504

Hive: close connection only if it exists
This commit is contained in:
Arik Fraimovich 2016-05-04 10:42:59 +03:00
commit b3844d3643

View File

@ -124,7 +124,8 @@ class Hive(BaseSQLQueryRunner):
logging.exception(e)
raise sys.exc_info()[1], None, sys.exc_info()[2]
finally:
connection.close()
if connection:
connection.close()
return json_data, error