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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to