You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by vi...@apache.org on 2021/09/06 11:54:13 UTC

[superset] 04/17: fix: call external metadata endpoint with correct rison object (#16369)

This is an automated email from the ASF dual-hosted git repository.

villebro pushed a commit to branch 1.3
in repository https://gitbox.apache.org/repos/asf/superset.git

commit cd4583331d134eb1d1902bb6625154bfdaf821c9
Author: Ville Brofeldt <33...@users.noreply.github.com>
AuthorDate: Fri Aug 20 11:43:57 2021 +0300

    fix: call external metadata endpoint with correct rison object (#16369)
    
    (cherry picked from commit 575ee24a99011bf5b4106d3f3cc57afb2a968cb5)
---
 superset-frontend/src/datasource/DatasourceEditor.jsx | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/superset-frontend/src/datasource/DatasourceEditor.jsx b/superset-frontend/src/datasource/DatasourceEditor.jsx
index c59b6ad..4bf2690 100644
--- a/superset-frontend/src/datasource/DatasourceEditor.jsx
+++ b/superset-frontend/src/datasource/DatasourceEditor.jsx
@@ -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 });