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 2022/05/13 18:37:30 UTC
[GitHub] [superset] rusackas commented on a diff in pull request #20013: fix: The dynamic form to connect to Snowflake DB is not returning any errors
rusackas commented on code in PR #20013:
URL: https://github.com/apache/superset/pull/20013#discussion_r872682528
##########
superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx:
##########
@@ -1083,15 +1085,23 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
// eslint-disable-next-line consistent-return
const errorAlert = () => {
+ let alertErrors: string[] = [];
if (isEmpty(dbErrors) === false) {
- const message: Array<string> =
- typeof dbErrors === 'object' ? Object.values(dbErrors) : [];
+ alertErrors = typeof dbErrors === 'object' ? Object.values(dbErrors) : [];
+ } else if (db?.engine === Engines.Snowflake) {
+ alertErrors =
+ validationErrors?.error_type === 'GENERIC_DB_ENGINE_ERROR'
+ ? [validationErrors?.description]
+ : [];
+ }
+
+ if (alertErrors.length) {
return (
<Alert
type="error"
css={(theme: SupersetTheme) => antDErrorAlertStyles(theme)}
message={t('Database Creation Error')}
- description={message?.[0] || dbErrors}
+ description={t(alertErrors[0])}
Review Comment:
Looking above at line 1095, it seems there's a condition where `alertErrors` might be `[]`, in which case this would be translating/displaying `undefined` right?
--
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