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 2020/06/24 08:13:44 UTC

[GitHub] [incubator-superset] villebro commented on a change in pull request #10113: feat(viz): add query mode switch for table chart

villebro commented on a change in pull request #10113:
URL: https://github.com/apache/incubator-superset/pull/10113#discussion_r444714980



##########
File path: superset/viz.py
##########
@@ -553,6 +554,10 @@ def json_data(self) -> str:
         return json.dumps(self.data)
 
 
+QUERY_MODE_RAW = "raw"
+QUERY_MODE_AGGREGATE = "aggregate"

Review comment:
       These should probably be placed in `utils/core.py` as
   ```python
   class QueryMode(str, Enum):
       RAW = "raw"
      AGGREGATE = "aggregate"
   ```
   I would also suggest adding a deprecated type for detecting query mode, which would look at the presence of `all_columns`, and flag as `raw` is present, and `aggregate` if not.

##########
File path: superset-frontend/src/explore/components/Control.jsx
##########
@@ -27,7 +27,10 @@ const controlTypes = Object.keys(controlMap);
 const propTypes = {
   actions: PropTypes.object.isRequired,
   name: PropTypes.string.isRequired,
-  type: PropTypes.oneOf(controlTypes).isRequired,
+  type: PropTypes.oneOfType([
+    PropTypes.oneOf(controlTypes).isRequired,
+    PropTypes.func.isRequired,
+  ]),

Review comment:
       Should this be
   ```suggestion
     type: PropTypes.oneOf([controlTypes, PropTypes.func]).isRequired,
   ```




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

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