Эх сурвалжийг харах

[editor] Include source type in calls to API from table stats

Johan Ahlen 10 жил өмнө
parent
commit
175e8fd

+ 3 - 3
desktop/core/src/desktop/static/desktop/js/assist/tableStats.js

@@ -106,7 +106,7 @@
     };
 
     self.assistHelper.fetchStats({
-      sourceType: self.sourceType,
+      sourceType: self.sourceType === "hive" ? "beeswax" : self.sourceType,
       databaseName: self.database,
       tableName: self.table,
       columnName: self.column,
@@ -124,7 +124,7 @@
     self.refreshing(true);
 
     self.assistHelper.refreshTableStats({
-      sourceType: self.sourceType,
+      sourceType: self.sourceType === "hive" ? "beeswax" : self.sourceType,
       databaseName: self.database,
       tableName: self.table,
       columnName: self.column,
@@ -150,7 +150,7 @@
 
     self.loadingTerms(true);
     self.assistHelper.fetchTerms({
-      sourceType: self.sourceType,
+      sourceType: self.sourceType === "hive" ? "beeswax" : self.sourceType,
       databaseName: self.database,
       tableName: self.table,
       columnName: self.column,

+ 1 - 0
desktop/core/src/desktop/templates/assist.mako

@@ -132,6 +132,7 @@ from desktop.views import _ko
       <a class="inactive-action" href="javascript:void(0)" data-bind="visible: definition.isTable, click: showPreview"><i class="fa fa-list" title="${_('Preview Sample data')}"></i></a>
       <span data-bind="component: { name: 'table-stats', params: {
           statsVisible: statsVisible,
+          sourceType: assistSource.type,
           snippet: assistSource.snippet,
           databaseName: databaseName,
           tableName: tableName,

+ 1 - 0
desktop/core/src/desktop/templates/table_stats.mako

@@ -178,6 +178,7 @@ from desktop.views import _ko
           } else {
             self.analysisStats(new TableStats({
               i18n: self.i18n,
+              sourceType: self.params.sourceType,
               snippet: self.params.snippet,
               databaseName: self.params.databaseName,
               tableName: self.params.tableName,