diff --git a/sqlmesh/core/snapshot/evaluator.py b/sqlmesh/core/snapshot/evaluator.py index 3e622d2dd1..cdcbdfc078 100644 --- a/sqlmesh/core/snapshot/evaluator.py +++ b/sqlmesh/core/snapshot/evaluator.py @@ -1440,8 +1440,9 @@ def _can_clone(self, snapshot: Snapshot, deployability_index: DeployabilityIndex and adapter.SUPPORTS_CLONING # managed models cannot have their schema mutated because theyre based on queries, so clone + alter wont work and not snapshot.is_managed - # If the deployable table is missing we can't clone it and not deployability_index.is_deployable(snapshot) + # If the deployable table is missing we can't clone it + and adapter.table_exists(snapshot.table_name()) ) def _get_data_objects( diff --git a/tests/core/engine_adapter/integration/test_integration.py b/tests/core/engine_adapter/integration/test_integration.py index e02877e0c6..5a708e1e4c 100644 --- a/tests/core/engine_adapter/integration/test_integration.py +++ b/tests/core/engine_adapter/integration/test_integration.py @@ -22,6 +22,7 @@ from sqlmesh import Config, Context from sqlmesh.cli.project_init import init_example_project +from sqlmesh.core.config.common import VirtualEnvironmentMode from sqlmesh.core.config.connection import ConnectionConfig import sqlmesh.core.dialect as d from sqlmesh.core.environment import EnvironmentSuffixTarget @@ -1938,7 +1939,12 @@ def test_transaction(ctx: TestContext): ctx.compare_with_current(table, input_data) -def test_sushi(ctx: TestContext, tmp_path: pathlib.Path): +@pytest.mark.parametrize( + "virtual_environment_mode", [VirtualEnvironmentMode.FULL, VirtualEnvironmentMode.DEV_ONLY] +) +def test_sushi( + ctx: TestContext, tmp_path: pathlib.Path, virtual_environment_mode: VirtualEnvironmentMode +): if ctx.mark == "athena_hive": pytest.skip( "Sushi end-to-end tests only need to run once for Athena because sushi needs a hybrid of both Hive and Iceberg" @@ -1984,6 +1990,7 @@ def _mutate_config(gateway: str, config: Config) -> None: ).sql(dialect=config.model_defaults.dialect) for e in before_all ] + config.virtual_environment_mode = virtual_environment_mode context = ctx.create_context(_mutate_config, path=tmp_path, ephemeral_state_connection=False)