소스 검색

HUE-8738 [task] Protect against missing query key in check status

Romain 5 년 전
부모
커밋
8740cc04cc
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      desktop/libs/notebook/src/notebook/tasks.py

+ 4 - 1
desktop/libs/notebook/src/notebook/tasks.py

@@ -487,7 +487,10 @@ def _cleanup(notebook, snippet):
   caches[CACHES_CELERY_KEY].delete(_fetch_progress_key(notebook, snippet))
 
 def _get_query_key(notebook, snippet):
-  return snippet['executor']['executables'][0]['history']['uuid'] if ENABLE_NOTEBOOK_2.get() else notebook['uuid']
+  if ENABLE_NOTEBOOK_2.get():
+    return snippet['executor']['executables'][0].get('history', {}).get('uuid')
+  else:
+    return notebook['uuid']
 
 def _log_key(notebook, snippet):
   return _get_query_key(notebook, snippet) + '_log'