korbit-ai[bot] commented on code in PR #33965:
URL: https://github.com/apache/superset/pull/33965#discussion_r2222277608
##########
superset-frontend/src/features/databases/DatabaseModal/index.tsx:
##########
@@ -316,7 +316,11 @@ export function dbReducer(
...extraJson,
schemas_allowed_for_file_upload: (action.payload.value || '')
.split(',')
- .filter(schema => schema !== ''),
+ .filter((schema, index, arr) => {
+ const trimmed = schema.trim();
+ if (index === arr.length - 1) return true;
+ return trimmed !== '';
+ }),
Review Comment:
The issue is that trailing commas add empty schemas. Let's modify the filter
to only keep non-empty strings:
```typescript
.split(',')
.filter(schema => {
const trimmed = schema.trim();
return trimmed !== '';
})
```
This will correctly handle "bar," by keeping only ["bar"] without empty
strings.
--
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]