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/07/02 02:49:22 UTC

[GitHub] [incubator-superset] etr2460 commented on a change in pull request #10226: chore: type ResultSet.tsx

etr2460 commented on a change in pull request #10226:
URL: https://github.com/apache/incubator-superset/pull/10226#discussion_r448718360



##########
File path: superset-frontend/spec/javascripts/sqllab/fixtures.js
##########
@@ -387,7 +387,7 @@ export const stoppedQuery = {
   startDttm: 1497400851936,
   state: 'stopped',
   tab: 'Untitled Query 2',
-  tempTableName: '',
+  tempTable: '',

Review comment:
       I aligned on this name everywhere because that's how the backend sends it

##########
File path: superset-frontend/src/SqlLab/components/ResultSet.tsx
##########
@@ -235,20 +236,21 @@ export default class ResultSet extends React.PureComponent {
           <Alert bsStyle="info">
             {t(object)} [
             <strong>
-              {tmpSchema}.{tmpTable}
+              {tempSchema ? `${tempSchema}.` : ''}

Review comment:
       When testing on sqllite, there wasn't always a schema, so i cleaned up the cases where schema can be null

##########
File path: superset-frontend/src/SqlLab/components/ResultSet.tsx
##########
@@ -218,14 +226,7 @@ export default class ResultSet extends React.PureComponent {
         </Alert>
       );
     } else if (query.state === 'success' && query.ctas) {
-      // Async queries
-      let tmpSchema = query.tempSchema;
-      let tmpTable = query.tempTableName;
-      // Sync queries, query.results.query contains the source of truth for them.
-      if (query.results && query.results.query) {
-        tmpTable = query.results.query.tempTable;
-        tmpSchema = query.results.query.tempSchema;
-      }

Review comment:
       this logic is moved to the reducer, it seems cleaner (although it's a big janky to have the query in 2 different places here)




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