def fetch_result_data(self, user, operation_id): from notebook.api import _fetch_result_data return _fetch_result_data(user, operation_id=operation_id, rows=100, start_over=False, nulls_only=True)
def _query_result(request, notebook, max_rows): snippet = notebook['snippets'][0] snippet['statement'] = notebook['snippets'][0]['statement_raw'] query_execute = _execute_notebook(request, notebook, snippet) history_uuid = query_execute['history_uuid'] status = _check_status(request, operation_id=history_uuid) if status['query_status']['status'] == 'available': res = _fetch_result_data(request, operation_id=history_uuid, rows=max_rows) return res['result'] return None
def query_result(request, notebook): snippet = notebook['snippets'][0] snippet['statement'] = notebook['snippets'][0]['statement_raw'] query_execute = _execute_notebook(request, notebook, snippet) history_uuid = query_execute['history_uuid'] status = _check_status(request, operation_id=history_uuid) if status['query_status']['status'] == 'available': response = _fetch_result_data(request, operation_id=history_uuid) return response['result'] return 'Query result has expired or could not be found'