-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(wren-ui): support generate wren sql from dialect sql #1539
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a66cd78
feat: Add model substitution support and improve error handling - Add…
onlyjackfrost 2a02c5b
revert docker-compose-dev
onlyjackfrost 6d554c9
rm console
onlyjackfrost 827b45f
add header for setting default catalog and schema
onlyjackfrost a0dd596
refactor
onlyjackfrost d7c2893
update header
onlyjackfrost 2b252ae
format sql
onlyjackfrost b2f29f4
feat(wren-ui): Import from data source SQL (#1553)
andreashimin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Inconsistent error handling approach in validate method.
The validate method returns an error response instead of throwing exceptions, which is inconsistent with other methods that use the throwError function. Consider making the error handling approach consistent across all methods.
public async validate( dataSource: DataSourceName, validationRule: ValidationRules, connectionInfo: WREN_AI_CONNECTION_INFO, mdl: Manifest, parameters: Record<string, any>, ): Promise<ValidationResponse> { connectionInfo = this.updateConnectionInfo(connectionInfo); const ibisConnectionInfo = toIbisConnectionInfo(dataSource, connectionInfo); const body = { connectionInfo: ibisConnectionInfo, manifestStr: Buffer.from(JSON.stringify(mdl)).toString('base64'), parameters, }; try { logger.debug(`Run validation rule "${validationRule}" with ibis`); await axios.post( `${this.ibisServerEndpoint}/${this.getIbisApiVersion(IBIS_API_TYPE.VALIDATION)}/connector/${dataSourceUrlMap[dataSource]}/validate/${snakeCase(validationRule)}`, body, ); return { valid: true, message: null }; - } catch (e) { - logger.debug(`Validation error: ${e.response?.data || e.message}`); - return { valid: false, message: e.response?.data || e.message }; - } + } catch (e) { + logger.debug(`Validation error: ${e.response?.data || e.message}`); + // Either convert all methods to return errors like this, or make this one throw like the others + return { valid: false, message: e.response?.data || e.message }; + } }📝 Committable suggestion