[editor] Error popup when exploring table from assist and NavOpt on
This query is a task, not a end user typed query and should not be uploaded.
@@ -362,6 +362,7 @@ def upload_query(request):
query_id = request.POST.get('query_id')
if OPTIMIZER.AUTO_UPLOAD_QUERIES.get() and source_platform in ('hive', 'impala') and query_id:
+ try:
doc = Document2.objects.document(request.user, doc_id=query_id)
query_data = Notebook(document=doc).get_data()
@@ -371,6 +372,8 @@ def upload_query(request):
api = OptimizerApi(request.user)
response['query_upload'] = api.upload(data=queries, data_type='queries', source_platform=source_platform)
+ except Document2.DoesNotExist:
+ response['query_upload'] = _('Skipped as task query')
else:
response['query_upload'] = _('Skipped')
response['status'] = 0
