eschutho commented on a change in pull request #14293:
URL: https://github.com/apache/superset/pull/14293#discussion_r619529440
##########
File path: superset-frontend/src/views/CRUD/data/database/DatabaseModal.tsx
##########
@@ -205,6 +203,14 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps>
= ({
fetchResource(id)
.then(() => {
+ // Altering 'extra' JSON before returning it to 'extra' text field
+ if (dbFetched && dbFetched.extra) {
+ const fetchedExtra = dbFetched?.extra;
+ const parsed = JSON.parse(fetchedExtra ?? defaultExtra);
+ delete parsed.metadata_cache_timeout;
+ delete parsed.schemas_allowed_for_csv_upload;
+ dbFetched.extra = JSON.stringify(parsed) ?? defaultExtra;
Review comment:
I think you want `||` here in case the stringified parse is an empty
string.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]