Closed john-bodley closed 2 years ago
The resolution is that the public DB API methods should only raise PEP 249 exceptions.
Or change existing exceptions to be subclasses of the predefined ones. Thanks for reporting this. Can you elaborate a bit on what you mean by "are not correctly handled by downstream interfaces including SQLAlchemy, Apache Superset, etc."? What do you observe?
@hashhar see https://github.com/apache/superset/pull/20729 for details, specifically this comment.
The Trino DB API raises exceptions outside the PEP 249 database API specification and thus are not correctly handled by downstream interfaces including SQLAlchemy, Apache Superset, etc.
For example the DB API cursor
fetchall
method is raising aTrinoUserError
which is not derived from a PEP 249 exception.The resolution is that the public DB API methods should only raise PEP 249 exceptions.