You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/02/21 15:04:20 UTC

[GitHub] [superset] kgabryje commented on a change in pull request #18835: fix(Explore): Pivot table V2 sort by failure with D&D enabled

kgabryje commented on a change in pull request #18835:
URL: https://github.com/apache/superset/pull/18835#discussion_r811215335



##########
File path: superset-frontend/packages/superset-ui-core/src/query/buildQueryObject.ts
##########
@@ -89,6 +92,14 @@ export default function buildQueryObject<T extends QueryFormData>(
     ...extras,
     ...filterFormData,
   });
+  const isAdhocColumn = (v?: AdhocColumn | PhysicalColumn) =>
+    (v as AdhocColumn)?.sqlExpression !== undefined;
+  const normalizeSeriesLimitMetric = (v: QueryFormColumn | undefined) => {
+    if (isAdhocColumn(v) || (v as PhysicalColumn)?.length) {

Review comment:
       `Boolean('')` returns false, so I think checking for length is redundant here. How about something like this?
   ```suggestion
       if (isAdhocColumn(v) || (isPhysicalColumn(v) && v) {
   ```

##########
File path: superset-frontend/packages/superset-ui-core/src/query/buildQueryObject.ts
##########
@@ -89,6 +92,14 @@ export default function buildQueryObject<T extends QueryFormData>(
     ...extras,
     ...filterFormData,
   });
+  const isAdhocColumn = (v?: AdhocColumn | PhysicalColumn) =>

Review comment:
       We already have `isAdhocColumn` in `superset-frontend/packages/superset-ui-chart-controls/src/types.ts`




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org