diff --git a/sqlmesh/core/engine_adapter/trino.py b/sqlmesh/core/engine_adapter/trino.py index 90b3da5240..0e6853dd4a 100644 --- a/sqlmesh/core/engine_adapter/trino.py +++ b/sqlmesh/core/engine_adapter/trino.py @@ -128,7 +128,7 @@ def replace_query( supports_replace_table_override: t.Optional[bool] = None, **kwargs: t.Any, ) -> None: - catalog_type = self.get_catalog_type(self.get_catalog_type_from_table(table_name)) + catalog_type = self.get_catalog_type_from_table(table_name) # User may have a custom catalog type name so we are assuming they keep the catalog type still in the name # Ex: `acme_iceberg` would be identified as an iceberg catalog and therefore supports replace table supports_replace_table_override = None diff --git a/tests/core/engine_adapter/test_trino.py b/tests/core/engine_adapter/test_trino.py index 930834c8d1..07c4657eb3 100644 --- a/tests/core/engine_adapter/test_trino.py +++ b/tests/core/engine_adapter/test_trino.py @@ -70,8 +70,7 @@ def test_get_catalog_type( "sqlmesh.core.engine_adapter.trino.TrinoEngineAdapter.get_current_catalog", return_value=f"system_{storage_type}", ) - expected_current_type = storage_type - assert adapter.current_catalog_type == expected_current_type + assert adapter.current_catalog_type == storage_type def test_get_catalog_type_cached( @@ -114,8 +113,7 @@ def test_partitioned_by_hive_delta( "sqlmesh.core.engine_adapter.trino.TrinoEngineAdapter.get_current_catalog", return_value=f"datalake_{storage_type}", ) - expected_type = storage_type - assert adapter.get_catalog_type(f"datalake_{storage_type}") == expected_type + assert adapter.get_catalog_type(f"datalake_{storage_type}") == storage_type columns_to_types = { "cola": exp.DataType.build("INT"),