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
3 changes: 2 additions & 1 deletion sqlmesh/core/snapshot/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
9 changes: 8 additions & 1 deletion tests/core/engine_adapter/integration/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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)

Expand Down