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/01/14 12:26:55 UTC

[GitHub] [superset] zhaoyongjie commented on a change in pull request #18045: feat(advanced analytics): support groupby in resample

zhaoyongjie commented on a change in pull request #18045:
URL: https://github.com/apache/superset/pull/18045#discussion_r784803988



##########
File path: superset-frontend/packages/superset-ui-chart-controls/src/operators/resampleOperator.ts
##########
@@ -28,13 +32,21 @@ export const resampleOperator: PostProcessingFactory<
   const resampleMethod = resampleZeroFill ? 'asfreq' : formData.resample_method;
   const resampleRule = formData.resample_rule;
   if (resampleMethod && resampleRule) {
+    const groupby_columns = ensureIsArray(queryObject.columns).map(column => {
+      if (isPhysicalColumn(column)) {
+        return column;
+      }
+      return column.label;
+    });

Review comment:
       I think the `sqlExpression` can't fit in `pandas` column, so I deliberately let it produce `undefine`.
   
   ```
   ....
   export default function getColumnLabel(column: QueryFormColumn): string {
     if (isPhysicalColumn(column)) {
       return column;
     }
     if (column.label) {
       return column.label;
     }
     return column.sqlExpression;
   }
   ```




-- 
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