Explorar o código

HUE-8867 [metastore] Expanding columns of a table in left assist fails

When Filebrowser is disabled.
Romain %!s(int64=6) %!d(string=hai) anos
pai
achega
d9f22fcd8c

+ 1 - 1
apps/metastore/src/metastore/views.py

@@ -46,8 +46,8 @@ from metastore.settings import DJANGO_APPS
 
 from desktop.auth.backend import is_admin
 
-LOG = logging.getLogger(__name__)
 
+LOG = logging.getLogger(__name__)
 SAVE_RESULTS_CTAS_TIMEOUT = 300         # seconds
 
 

+ 12 - 2
desktop/core/src/desktop/lib/view_util.py

@@ -16,14 +16,18 @@
 # limitations under the License.
 """Utilities for views (text and number formatting, etc)"""
 
-import math
 import datetime
+import logging
+import math
 
 from django.urls import reverse
 
 from hadoop.fs.hadoopfs import Hdfs
 
 
+LOG = logging.getLogger(__name__)
+
+
 def big_filesizeformat(bytes):
   if bytes is None or bytes is "":
     return "N/A"
@@ -103,7 +107,13 @@ def location_to_url(location, strict=True, is_embeddable=False):
     if split_path[0] == 'hdfs':
       path = split_path[2]
 
-    filebrowser_path = reverse("filebrowser.views.view", kwargs=dict(path=path))
+    try:
+      filebrowser_path = reverse("filebrowser.views.view", kwargs=dict(path=path))
+    except Exception as e:
+      LOG.warn('No table filesystem link: %s' % e)
+      return None
+
     if is_embeddable and not filebrowser_path.startswith('/hue'):
         filebrowser_path = '/hue' + filebrowser_path
+
     return filebrowser_path