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 2018/06/01 16:34:13 UTC
[GitHub] mistercrunch commented on a change in pull request #4834: Load
async sql lab results early for Presto
mistercrunch commented on a change in pull request #4834: Load async sql lab results early for Presto
URL: https://github.com/apache/incubator-superset/pull/4834#discussion_r192438701
##########
File path: superset/assets/src/SqlLab/components/ResultSet.jsx
##########
@@ -214,14 +216,68 @@ export default class ResultSet extends React.PureComponent {
}
let progressBar;
let trackingUrl;
- if (query.progress > 0 && query.state === 'running') {
+ if (query.progress > 0 && (query.state === 'running' || query.state === 'prefetched')) {
progressBar = (
<ProgressBar
striped
now={query.progress}
label={`${query.progress}%`}
/>);
}
+
+ if (query.state === 'prefetched') {
+ const results = query.results;
+ let data;
+ if (this.props.cache && query.cached) {
+ data = this.state.data;
+ } else if (results && results.data) {
+ data = results.data;
+ }
+ if (!this.props.has_prefetched) {
+ if (data && data.length > 0) {
+ return (
+ <div>
+ <div>
+ {progressBar}
+ </div>
+ <VisualizeModal
Review comment:
This whole section is copy pasted from earlier in this very method. This should be refactored into its own component, or at least a `renderDataSection` method or something like that, that would receive different props/params as needed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org