Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sqlmesh/core/engine_adapter/trino.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions tests/core/engine_adapter/test_trino.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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"),
Expand Down