diff --git a/trino/sqlalchemy/dialect.py b/trino/sqlalchemy/dialect.py index 21011b6f..2ecd5771 100644 --- a/trino/sqlalchemy/dialect.py +++ b/trino/sqlalchemy/dialect.py @@ -29,7 +29,6 @@ OAuth2Authentication, ) from trino.dbapi import Cursor -from trino.exceptions import TrinoUserError from trino.sqlalchemy import compiler, datatype, error logger = logging.get_logger(__name__) @@ -281,11 +280,11 @@ def get_indexes(self, connection: Connection, table_name: str, schema: str = Non if not self.has_table(connection, table_name, schema): raise exc.NoSuchTableError(f"schema={schema}, table={table_name}") + partitioned_columns = None try: partitioned_columns = self._get_columns(connection, f"{table_name}$partitions", schema, **kw) - # some connector does not support $partitions table suffix so trying without appending that - except TrinoUserError: - partitioned_columns = self._get_columns(connection, table_name, schema, **kw) + except Exception as e: + logger.debug("Couldn't fetch partition columns. table_name: %s, schema: %s, error: %s", table_name, schema, e) if not partitioned_columns: return [] partition_index = dict(