diff --git a/metadata-ingestion/src/datahub/ingestion/source/sql/trino.py b/metadata-ingestion/src/datahub/ingestion/source/sql/trino.py index b7bdbbdaca616b..03a85a5f978456 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/sql/trino.py +++ b/metadata-ingestion/src/datahub/ingestion/source/sql/trino.py @@ -13,7 +13,7 @@ from sqlalchemy.sql import sqltypes from sqlalchemy.types import TypeEngine from trino.exceptions import TrinoQueryError -from trino.sqlalchemy import datatype, error +from trino.sqlalchemy import datatype from trino.sqlalchemy.dialect import TrinoDialect from datahub.ingestion.api.common import PipelineContext @@ -82,13 +82,8 @@ def get_table_comment(self, connection, table_name: str, schema: str = None, **k return {"text": properties.get("comment", None), "properties": properties} # Fallback to default trino-sqlalchemy behaviour if `$properties` table doesn't exist - except TrinoQueryError as e: - if e.error_name in ( - error.TABLE_NOT_FOUND, - error.COLUMN_NOT_FOUND, - error.NOT_FOUND, - ): - return self.get_table_comment_default(connection, table_name, schema) + except TrinoQueryError: + return self.get_table_comment_default(connection, table_name, schema) # Exception raised when using Starburst Delta Connector that falls back to a Hive Catalog except exc.ProgrammingError as e: if isinstance(e.orig, TrinoQueryError):