Skip to content

Commit 7cdbcde

Browse files
authored
fix: trino catalog lookup (#5283)
1 parent 75f825e commit 7cdbcde

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

sqlmesh/core/engine_adapter/trino.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def replace_query(
128128
supports_replace_table_override: t.Optional[bool] = None,
129129
**kwargs: t.Any,
130130
) -> None:
131-
catalog_type = self.get_catalog_type(self.get_catalog_type_from_table(table_name))
131+
catalog_type = self.get_catalog_type_from_table(table_name)
132132
# User may have a custom catalog type name so we are assuming they keep the catalog type still in the name
133133
# Ex: `acme_iceberg` would be identified as an iceberg catalog and therefore supports replace table
134134
supports_replace_table_override = None

tests/core/engine_adapter/test_trino.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ def test_get_catalog_type(
7070
"sqlmesh.core.engine_adapter.trino.TrinoEngineAdapter.get_current_catalog",
7171
return_value=f"system_{storage_type}",
7272
)
73-
expected_current_type = storage_type
74-
assert adapter.current_catalog_type == expected_current_type
73+
assert adapter.current_catalog_type == storage_type
7574

7675

7776
def test_get_catalog_type_cached(
@@ -114,8 +113,7 @@ def test_partitioned_by_hive_delta(
114113
"sqlmesh.core.engine_adapter.trino.TrinoEngineAdapter.get_current_catalog",
115114
return_value=f"datalake_{storage_type}",
116115
)
117-
expected_type = storage_type
118-
assert adapter.get_catalog_type(f"datalake_{storage_type}") == expected_type
116+
assert adapter.get_catalog_type(f"datalake_{storage_type}") == storage_type
119117

120118
columns_to_types = {
121119
"cola": exp.DataType.build("INT"),

0 commit comments

Comments
 (0)