Hive: close connection only if it exists

This commit is contained in:
Arik Fraimovich
2016-05-04 10:40:53 +03:00
parent 7062873cd1
commit e32bfe3db7

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