betodealmeida commented on a change in pull request #5915: [WIP] Google
spreadsheets
URL:
https://github.com/apache/incubator-superset/pull/5915#discussion_r217974334
##########
File path: superset/assets/src/SqlLab/components/SqlEditorLeftBar.jsx
##########
@@ -95,18 +95,9 @@ class SqlEditorLeftBar extends React.PureComponent {
this.setState({ tableName: '' });
return;
}
- const namePieces = tableOpt.value.split('.');
- let tableName = namePieces[0];
- let schemaName = this.props.queryEditor.schema;
- if (namePieces.length === 1) {
- this.setState({ tableName });
- } else {
- schemaName = namePieces[0];
- tableName = namePieces[1];
- this.setState({ tableName });
- this.props.actions.queryEditorSetSchema(this.props.queryEditor,
schemaName);
- this.fetchTables(this.props.queryEditor.dbId, schemaName);
- }
Review comment:
The current code allows switching schema by typing `new_schema.some_table`
in the table selector. The code breaks when the table name has a period in it,
since it does naive splitting. I opted for removing it here, since it seems a
bit unintuitive as well.
----------------------------------------------------------------
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]