villebro commented on code in PR #20056:
URL: https://github.com/apache/superset/pull/20056#discussion_r875896912


##########
superset-frontend/src/SqlLab/components/ResultSet/index.tsx:
##########
@@ -343,7 +343,7 @@ export default class ResultSet extends React.PureComponent<
           metrics: [],
           groupby: [],
           time_range: 'No filter',
-          viz_type: 'table',
+          viz_type: '',

Review Comment:
   In bootstrap data we have `common.conf` which contains `DEFAULT_VIZ_TYPE` 
(you can check the page source and look for `data-bootstrap="..."`). Instead of 
passing this as an empty string, I would propose one of the following:
   1. passing the `DEFAULT_VIZ_TYPE` to this component from wherever the 
bootstrap data is available, or
   2. Removing it all together, and then just replacing it with 
`DEFAULT_VIZ_TYPE` is if's undefined in the backend.



##########
superset-frontend/src/SqlLab/components/ResultSet/index.tsx:
##########
@@ -343,7 +343,7 @@ export default class ResultSet extends React.PureComponent<
           metrics: [],
           groupby: [],
           time_range: 'No filter',
-          viz_type: 'table',
+          viz_type: '',
           all_columns: selectedColumns.map(c => c.name),

Review Comment:
   The `all_columns` prop is mostly specific to the table chart, so we may need 
to consider if this logic also needs to be made configurable. Since it will be 
very difficult to define a callback in Python that gets executed on the 
frontend, it may be better do also populate the default form data in the 
backend (option 2)



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