Skip to content

Commit

Permalink
fix: call external metadata endpoint with correct rison object
Browse files Browse the repository at this point in the history
  • Loading branch information
villebro committed Aug 20, 2021
1 parent 50d896f commit 8eb093a
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 8eb093a

Please sign in to comment.