You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 a TrinoUserError which is not derived from a PEP 249 exception.
...
File "/usr/local/lib/python3.9/dist-packages/trino/dbapi.py", line 560, in fetchall
return list(self.genall())
File "/usr/local/lib/python3.9/dist-packages/trino/client.py", line 512, in __iter__
rows = self._query.fetch()
File "/usr/local/lib/python3.9/dist-packages/trino/client.py", line 685, in fetch
status = self._request.process(response)
File "/usr/local/lib/python3.9/dist-packages/trino/client.py", line 443, in process
raise self._process_error(response["error"], response.get("id"))
trino.exceptions.TrinoUserError: TrinoUserError(type=USER_ERROR, name=NOT_SUPPORTED, message="line 1:1: Relation 'foo.bar' is a table, not a view", query_id=20220715_233855_30555_sz8ja)
The resolution is that the public DB API methods should only raise PEP 249 exceptions.
The text was updated successfully, but these errors were encountered:
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?
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.
The text was updated successfully, but these errors were encountered: