Explorar el Código

HUE-9187 [editor] Log connector dialect name instead of connector id

As ids are more personal and dialect name more useful to know.
Romain hace 5 años
padre
commit
f34ada1cab

+ 3 - 2
desktop/core/src/desktop/js/api/apiHelper.js

@@ -1866,11 +1866,12 @@ class ApiHelper {
    */
   async executeStatement(options) {
     const executable = options.executable;
-    const url = EXECUTE_API_PREFIX + executable.executor.connector().type;
+    const url = EXECUTE_API_PREFIX + executable.executor.connector().dialect;
 
     const promise = new Promise(async (resolve, reject) => {
       let data = {};
-      if (executable.executor.snippet) {  // V1
+      if (executable.executor.snippet) {
+        // V1
         // TODO: Refactor away the snippet, it currently works because snippet.statement is a computed from
         // the active executable, but we n
         data = {

+ 4 - 3
desktop/core/src/desktop/js/apps/notebook2/execution/executable.js

@@ -169,7 +169,7 @@ export default class Executable {
     try {
       hueAnalytics.log(
         'notebook',
-        'execute/' + (this.executor.connector() ? this.executor.connector().type : '')
+        'execute/' + (this.executor.connector() ? this.executor.connector().dialect : '')
       );
       try {
         const response = await this.internalExecute();
@@ -313,7 +313,7 @@ export default class Executable {
     if (this.cancellables.length && this.status === EXECUTION_STATUS.running) {
       hueAnalytics.log(
         'notebook',
-        'cancel/' + (this.executor.connector() ? this.executor.connector().type : '')
+        'cancel/' + (this.executor.connector() ? this.executor.connector().dialect : '')
       );
       this.setStatus(EXECUTION_STATUS.canceling);
       while (this.cancellables.length) {
@@ -376,7 +376,8 @@ export default class Executable {
   }
 
   async toContext(id) {
-    if (this.snippet) {  // V1
+    if (this.snippet) {
+      // V1
       return {
         operationId: this.operationId,
         snippet: this.snippet.toContextJson(),

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

@@ -211,7 +211,7 @@ def _execute_notebook(request, notebook, snippet):
 @require_POST
 @check_document_access_permission
 @api_error_handler
-def execute(request, engine=None):
+def execute(request, dialect=None):
   notebook = json.loads(request.POST.get('notebook', '{}'))
   snippet = json.loads(request.POST.get('snippet', '{}'))
 

+ 1 - 1
desktop/libs/notebook/src/notebook/urls.py

@@ -52,7 +52,7 @@ urlpatterns += [
   url(r'^api/create_notebook/?$', notebook_api.create_notebook, name='create_notebook'),
   url(r'^api/create_session/?$', notebook_api.create_session, name='create_session'),
   url(r'^api/close_session/?$', notebook_api.close_session, name='close_session'),
-  url(r'^api/execute(?:/(?P<engine>.+))?/?$', notebook_api.execute, name='execute'),
+  url(r'^api/execute(?:/(?P<dialect>.+))?/?$', notebook_api.execute, name='execute'),
   url(r'^api/check_status/?$', notebook_api.check_status, name='check_status'),
   url(r'^api/fetch_result_data/?$', notebook_api.fetch_result_data, name='fetch_result_data'),
   url(r'^api/fetch_result_metadata/?$', notebook_api.fetch_result_metadata, name='fetch_result_metadata'),