فهرست منبع

[editor] Display popular table suggestions in editor2

Romain Rigaux 4 سال پیش
والد
کامیت
076fd2fccb

+ 1 - 1
desktop/core/src/desktop/js/apps/notebook2/components/aceEditor/autocomplete/AutocompleteResults.ts

@@ -1793,7 +1793,7 @@ class AutocompleteResults {
         }
       });
 
-      if (totalPopularity > 0 && Object.keys(popularityIndex).length) {
+      if (totalPopularity > 0 && popularityIndex.size > 0) {
         const tableSuggestions = await tablesPromise;
         tableSuggestions.forEach(suggestion => {
           const details = <DataCatalogEntry>suggestion.details;

+ 2 - 1
desktop/libs/metadata/src/metadata/optimizer_api.py

@@ -127,7 +127,8 @@ def top_tables(request):
       'popularity': table['workloadPercent'],
       'column_count': table['columnCount'],
       'total': table['total'],
-    } for table in data['results']
+    }
+    for table in data['results']
   ]
 
   response['top_tables'] = tables