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 2021/12/02 09:34:55 UTC

[GitHub] [superset] villebro commented on a change in pull request #17512: feat(explore): export csv data pivoted for Pivot Table [ID-9]

villebro commented on a change in pull request #17512:
URL: https://github.com/apache/superset/pull/17512#discussion_r760904258



##########
File path: superset-frontend/src/explore/components/ExploreActionButtons.tsx
##########
@@ -133,6 +153,7 @@ const ExploreActionButtons = (props: ExploreActionButtonsProps) => {
     disabled: !canDownloadCSV,
   });
 
+  console.log({ latestQueryFormData });

Review comment:
       oops!

##########
File path: superset-frontend/src/explore/components/ExploreActionButtons.tsx
##########
@@ -42,18 +44,27 @@ type ExploreActionButtonsProps = {
   actions: { redirectSQLLab: () => void; openPropertiesModal: () => void };
   canDownloadCSV: boolean;
   chartStatus: string;
-  latestQueryFormData: {};
+  latestQueryFormData: QueryFormData;
   queriesResponse: {};
   slice: { slice_name: string };
   addDangerToast: Function;
 };
 
+const VIZ_TYPES_PIVOT = ['pivot_table', 'pivot_table_v2'];

Review comment:
       nit: I wonder if we should call this `VIZ_TYPES_PIVOTABLE` to make it clear that it relates to whether or not the output can be pivoted or not, and not the chart type.

##########
File path: superset/charts/data/api.py
##########
@@ -221,6 +221,7 @@ def data(self) -> Response:
         if json_body is None:
             return self.response_400(message=_("Request is not JSON"))
 
+        form_data = json_body.pop("form_data", None)

Review comment:
       Do we need to pop here? Can't we just do
   ```suggestion
           form_data = json_body.get("form_data")
   ```




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