浏览代码

HUE-9143 [editor] Prevent exception when executing an Impala query in editor v2

Johan Ahlen 5 年之前
父节点
当前提交
0395adca8d
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      desktop/libs/notebook/src/notebook/api.py

+ 2 - 1
desktop/libs/notebook/src/notebook/api.py

@@ -162,7 +162,8 @@ def _execute_notebook(request, notebook, snippet):
         if 'id' in active_executable: # Editor v2
           # notebook_executable is the 1-to-1 match of active_executable in the notebook structure
           notebook_executable = [e for e in _snippet['executor']['executables'] if e['id'] == active_executable['id']][0]
-          notebook_executable['handle'] = response['handle']
+          if 'handle' in response:
+            notebook_executable['handle'] = response['handle']
           if history:
             notebook_executable['history'] = {
               'id': history.id,