aminghadersohi commented on code in PR #44909:
URL: https://github.com/apache/superset/pull/44909#discussion_r4201592349


##########
superset-frontend/packages/superset-ui-core/src/query/buildQueryContext.ts:
##########
@@ -59,9 +60,17 @@ export default function buildQueryContext(
   if (isXAxisSet(formData)) {
     queries = queries.map(query => normalizeTimeColumn(formData, query));
   }
+  const datasource = new DatasourceKey(formData.datasource).toObject();
+  if (datasource.type === DatasourceType.SemanticView) {
+    queries = queries.map(query =>
+      (query.series_limit ?? 0) > 0 && !query.series_columns?.length
+        ? { ...query, series_limit: 0 }

Review Comment:
   On a semantic view this zeroes the limit for Rose, Partition, Horizon and 
TimeTable, which send `is_timeseries: true` without `series_columns`; the 
backend infers them from `columns` and applies a GroupLimit, so a working top-N 
limit is silently dropped.
   
   ```suggestion
         (query.series_limit ?? 0) > 0 &&
         !query.series_columns?.length &&
         // the backend infers series_columns from columns for timeseries 
queries
         !(query.is_timeseries && query.metrics?.length)
           ? { ...query, series_limit: 0 }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to