When calling get_table_comment from Superset it fails with the following error:
2022-10-07 14:06:52,206:ERROR:root:'Engine' object has no attribute 'connection'
Traceback (most recent call last):
File "/opt/superset/superset/db_engine_specs/base.py", line 1026, in get_table_comment
comment = inspector.get_table_comment(table_name, schema)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/reflection.py", line 558, in get_table_comment
return self.dialect.get_table_comment(
File "/usr/local/lib/python3.8/site-packages/trino/sqlalchemy/dialect.py", line 267, in get_table_comment
catalog_name = self._get_default_catalog_name(connection)
File "/usr/local/lib/python3.8/site-packages/trino/sqlalchemy/dialect.py", line 336, in _get_default_catalog_name
dbapi_connection: trino_dbapi.Connection = connection.connection
AttributeError: 'Engine' object has no attribute 'connection'
Expected behavior
Call to
get_table_comment
should not fail.Actual behavior
When calling
get_table_comment
from Superset it fails with the following error:A similar issue was fixed in PyAthena: https://github.com/laughingman7743/PyAthena/issues/63. It makes me believe that the problem is not in Superset, but Trino client.
Steps To Reproduce
If you have a Superset setup with a Trino client, then:
Log output
No response
Operating System
Debian buster in Docker image python:3.8.13-slim-buster
Trino Python client version
0.316.0
Trino Server version
378.amzn.0
Python version
3.8.13
Are you willing to submit PR?