bito-code-review[bot] commented on PR #42851:
URL: https://github.com/apache/superset/pull/42851#issuecomment-5207625242
<!-- Bito Reply -->
The review suggestion is correct. The current implementation in
`superset/sql/execution/executor.py` catches `TemplateError` and wraps it in a
generic `SupersetTemplateException`, which loses specific error details (like
`SupersetSyntaxErrorException`) that might be provided by the template
processor. To resolve this, you should catch specific syntax-related exceptions
first and only fall back to the generic `SupersetTemplateException` for other
rendering errors.
**superset/sql/execution/executor.py**
```
try:
return tp.process_template(sql, **template_params)
except SupersetSyntaxErrorException:
raise
except TemplateError as ex:
raise SupersetTemplateException(str(ex)) from ex
```
--
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]