From 93551a65b845f430aaefaa50f75a40857f1b6ed6 Mon Sep 17 00:00:00 2001 From: Alanna Scott Date: Mon, 27 Mar 2017 14:38:12 -0700 Subject: [PATCH] only fetch tables if we have a schema, otherwise reset options. (#2490) --- .../assets/javascripts/SqlLab/components/SqlEditorLeftBar.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/superset/assets/javascripts/SqlLab/components/SqlEditorLeftBar.jsx b/superset/assets/javascripts/SqlLab/components/SqlEditorLeftBar.jsx index 61c2fe5390aab..0d65c230ddbfe 100644 --- a/superset/assets/javascripts/SqlLab/components/SqlEditorLeftBar.jsx +++ b/superset/assets/javascripts/SqlLab/components/SqlEditorLeftBar.jsx @@ -65,7 +65,7 @@ ${this.props.queryEditor.schema}/${input}`; } // TODO: move fetching methods to the actions. fetchTables(dbId, schema, substr) { - if (dbId) { + if (dbId && schema) { this.setState({ tableLoading: true, tableOptions: [] }); const url = `/superset/tables/${dbId}/${schema}/${substr}/`; $.get(url, (data) => { @@ -75,6 +75,8 @@ ${this.props.queryEditor.schema}/${input}`; tableLength: data.tableLength, }); }); + } else { + this.setState({ tableLoading: false, tableOptions: [] }); } } changeTable(tableOpt) {