Skip to content

Commit

Permalink
fix: call external metadata endpoint with correct rison object (apach…
Browse files Browse the repository at this point in the history
  • Loading branch information
villebro authored and Emmanuel Bavoux committed Nov 14, 2021
1 parent b034084 commit faa9c21
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions superset-frontend/src/datasource/DatasourceEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -493,11 +493,14 @@ class DatasourceEditor extends React.PureComponent {
schema_name: datasource.schema,
table_name: datasource.table_name,
};
const endpoint = `/datasource/external_metadata_by_name/?q=${rison.encode(
Object.entries(params).forEach(([key, value]) => {
// rison can't encode the undefined value
Object.keys(params).map(key =>
params[key] === undefined ? null : params[key],
),
if (value === undefined) {
params[key] = null;
}
});
const endpoint = `/datasource/external_metadata_by_name/?q=${rison.encode(
params,
)}`;
this.setState({ metadataLoading: true });

Expand Down

0 comments on commit faa9c21

Please sign in to comment.