浏览代码

HUE-8740 [sql] Fix jdbc / sqlalchemy describe db.

jdesjean 6 年之前
父节点
当前提交
cc8edd376a
共有 2 个文件被更改,包括 7 次插入13 次删除
  1. 6 12
      desktop/core/src/desktop/js/api/apiHelper.js
  2. 1 1
      desktop/libs/notebook/src/notebook/api.py

+ 6 - 12
desktop/core/src/desktop/js/api/apiHelper.js

@@ -1573,20 +1573,14 @@ class ApiHelper {
     const self = this;
     const deferred = $.Deferred();
 
-    let url;
-
-    if (options.path.length === 1) {
-      url = '/metastore/databases/' + options.path[0] + '/metadata';
-    } else {
-      url = '/notebook/api/describe/' + options.path[0];
+    let url = '/notebook/api/describe/' + options.path[0];
 
-      if (options.path.length > 1) {
-        url += '/' + options.path[1] + '/';
-      }
+    if (options.path.length > 1) {
+      url += '/' + options.path[1] + '/';
+    }
 
-      if (options.path.length > 2) {
-        url += 'stats/' + options.path.slice(2).join('/');
-      }
+    if (options.path.length > 2) {
+      url += 'stats/' + options.path.slice(2).join('/');
     }
 
     const data = {

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

@@ -836,7 +836,7 @@ def _get_statement_from_file(user, fs, snippet):
 
 @require_POST
 @api_error_handler
-def describe(request, database, table, column=None):
+def describe(request, database, table=None, column=None):
   response = {'status': -1, 'message': ''}
   notebook = json.loads(request.POST.get('notebook', '{}'))
   source_type = request.POST.get('source_type', '')