Skip to content

Commit

Permalink
Fetch schemas separately. (#2227)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkyryliuk committed Feb 23, 2017
1 parent 0296158 commit cad392e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,9 @@ ${this.props.queryEditor.schema}/${input}`;
const actualDbId = dbId || this.props.queryEditor.dbId;
if (actualDbId) {
this.setState({ schemaLoading: true });
const url = `/databasetablesasync/api/read?_flt_0_id=${actualDbId}`;
const url = `/superset/schemas/${actualDbId}/`;
$.get(url, (data) => {
const schemas = data.result[0].all_schema_names;
const schemaOptions = schemas.map((s) => ({ value: s, label: s }));
const schemaOptions = data.schemas.map((s) => ({ value: s, label: s }));
this.setState({ schemaOptions });
this.setState({ schemaLoading: false });
});
Expand Down
2 changes: 1 addition & 1 deletion superset/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1846,7 +1846,7 @@ def schemas(self, db_id):
@has_access_api
@expose("/tables/<db_id>/<schema>/<substr>/")
def tables(self, db_id, schema, substr):
"""endpoint to power the calendar heatmap on the welcome page"""
"""Endpoint to fetch the list of tables for given database"""
schema = utils.js_string_to_python(schema)
substr = utils.js_string_to_python(substr)
database = db.session.query(models.Database).filter_by(id=db_id).one()
Expand Down

0 comments on commit cad392e

Please sign in to comment.