Skip to content

Commit

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

Please sign in to comment.