You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/08/13 11:31:07 UTC
[GitHub] [superset] villebro commented on a change in pull request #16193: refactor: external metadata fetch API
villebro commented on a change in pull request #16193:
URL: https://github.com/apache/superset/pull/16193#discussion_r688443067
##########
File path: superset-frontend/src/datasource/DatasourceEditor.jsx
##########
@@ -485,11 +486,19 @@ class DatasourceEditor extends React.PureComponent {
syncMetadata() {
const { datasource } = this.state;
- const endpoint = `/datasource/external_metadata_by_name/${
- datasource.type || datasource.datasource_type
- }/${datasource.database.database_name || datasource.database.name}/${
- datasource.schema
- }/${datasource.table_name}/`;
+ const params = {
+ datasource_type: datasource.type || datasource.datasource_type,
+ database_name:
+ datasource.database.database_name || datasource.database.name,
+ schema_name: datasource.schema,
+ table_name: datasource.table_name,
+ };
+ const endpoint = `/datasource/external_metadata_by_name/?q=${rison.encode(
+ // rison can't encode the undefined value
+ Object.keys(params).map(key =>
+ params[key] === undefined ? null : params[key],
+ ),
Review comment:
Don't we need to encode the key/value pairs (`Object.entries`), not just the values (`Object.keys`)? (honest question, I haven't done a lot of this rison API stuff)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org