youngyjd commented on a change in pull request #6078: allow cache and force 
refresh on table list
URL: 
https://github.com/apache/incubator-superset/pull/6078#discussion_r224868639
 
 

 ##########
 File path: superset/assets/src/SqlLab/components/SqlEditorLeftBar.jsx
 ##########
 @@ -41,12 +41,10 @@ class SqlEditorLeftBar extends React.PureComponent {
   onDatabaseChange(db, force) {
     const val = db ? db.value : null;
     this.setState({ schemaOptions: [] });
+    this.setState({ tableOptions: [] });
     this.props.actions.queryEditorSetSchema(this.props.queryEditor, null);
     this.props.actions.queryEditorSetDb(this.props.queryEditor, val);
-    if (!(db)) {
-      this.setState({ tableOptions: [] });
-    } else {
-      this.fetchTables(val, this.props.queryEditor.schema);
 
 Review comment:
   fetchTables here makes no sense because the database has been changed but 
`this.props.queryEditor.schema` is still the schema selected for the previously 
selected db. 
   And it is set null on line 44:
   `this.props.actions.queryEditorSetSchema(this.props.queryEditor, null);`

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to