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/07/13 00:22:32 UTC

[GitHub] [superset] hughhhh commented on a change in pull request #15645: fix: Fix test connection for extra fields

hughhhh commented on a change in pull request #15645:
URL: https://github.com/apache/superset/pull/15645#discussion_r668340773



##########
File path: superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx
##########
@@ -316,6 +316,15 @@ function dbReducer(
 
 const DEFAULT_TAB_KEY = '1';
 
+const serializeExtra = (extraJson: DatabaseObject['extra_json']) =>
+  JSON.stringify({
+    ...extraJson,
+    metadata_params: JSON.parse((extraJson?.metadata_params as string) || '{}'),
+    engine_params: JSON.parse((extraJson?.engine_params as string) || '{}'),
+    schemas_allowed_for_csv_upload:
+      (extraJson?.schemas_allowed_for_csv_upload as string) || '[]',
+  });

Review comment:
       we tried this intially but would get error everytime the user would have a misformatted JSON. So we broke it out to seperate field then onCreate or testConn we'd serialize and create the request.




-- 
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