luizotavio32 commented on code in PR #34763: URL: https://github.com/apache/superset/pull/34763#discussion_r2298161450
########## superset-frontend/src/features/databases/UploadDataModel/index.tsx: ########## @@ -329,6 +337,18 @@ const UploadDataModal: FunctionComponent<UploadDataModalProps> = ({ form.resetFields(); }; + const validateTableName = + (currentDatabase: CurrentDatabase) => (_: any, value: string) => { + const isPrestoTrino = currentDatabase?.label + ?.toLowerCase() + .includes('trino'); + + if (isPrestoTrino && value.includes(' ')) { + return Promise.reject(t('Trino table names must not contain spaces')); + } + return Promise.resolve(); Review Comment: So you do you think it's better to run the name validation after the upload button is pressed ? ########## superset-frontend/src/features/databases/UploadDataModel/index.tsx: ########## @@ -329,6 +337,18 @@ const UploadDataModal: FunctionComponent<UploadDataModalProps> = ({ form.resetFields(); }; + const validateTableName = + (currentDatabase: CurrentDatabase) => (_: any, value: string) => { + const isPrestoTrino = currentDatabase?.label + ?.toLowerCase() + .includes('trino'); + + if (isPrestoTrino && value.includes(' ')) { + return Promise.reject(t('Trino table names must not contain spaces')); + } + return Promise.resolve(); Review Comment: So do you think it's better to run the name validation after the upload button is pressed ? -- 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-unsubscr...@superset.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For additional commands, e-mail: notifications-h...@superset.apache.org