Ver código fonte

HUE-8042 [editor] Avoid 500 error when the previous query handle was missing

Romain Rigaux 7 anos atrás
pai
commit
bcbb954820

+ 1 - 1
desktop/libs/notebook/src/notebook/connectors/hiveserver2.py

@@ -355,8 +355,8 @@ class HS2Api(Api):
     if (snippet['type'] == 'hive' and beeswax_conf.CLOSE_QUERIES.get()) or (snippet['type'] == 'impala' and impala_conf.CLOSE_QUERIES.get()):
     if (snippet['type'] == 'hive' and beeswax_conf.CLOSE_QUERIES.get()) or (snippet['type'] == 'impala' and impala_conf.CLOSE_QUERIES.get()):
       db = self._get_db(snippet)
       db = self._get_db(snippet)
 
 
-      handle = self._get_handle(snippet)
       try:
       try:
+        handle = self._get_handle(snippet)
         db.close_operation(handle)
         db.close_operation(handle)
       except Exception, e:
       except Exception, e:
         if 'no valid handle' in str(e):
         if 'no valid handle' in str(e):