@@ -1191,7 +1191,7 @@ def columns(table_name):
1191
1191
snapshot = make_snapshot (model , version = "1" )
1192
1192
snapshot .change_category = SnapshotChangeCategory .FORWARD_ONLY
1193
1193
1194
- evaluator .migrate ([snapshot ], {})
1194
+ evaluator .migrate ([snapshot ], {}, deployability_index = DeployabilityIndex . none_deployable () )
1195
1195
1196
1196
cursor_mock .execute .assert_has_calls (
1197
1197
[
@@ -1226,7 +1226,7 @@ def test_migrate_missing_table(mocker: MockerFixture, make_snapshot):
1226
1226
snapshot = make_snapshot (model , version = "1" )
1227
1227
snapshot .change_category = SnapshotChangeCategory .FORWARD_ONLY
1228
1228
1229
- evaluator .migrate ([snapshot ], {})
1229
+ evaluator .migrate ([snapshot ], {}, deployability_index = DeployabilityIndex . none_deployable () )
1230
1230
1231
1231
cursor_mock .execute .assert_has_calls (
1232
1232
[
@@ -1262,7 +1262,7 @@ def test_migrate_view(
1262
1262
snapshot = make_snapshot (model , version = "1" )
1263
1263
snapshot .change_category = change_category
1264
1264
1265
- evaluator .migrate ([snapshot ], {})
1265
+ evaluator .migrate ([snapshot ], {}, deployability_index = DeployabilityIndex . none_deployable () )
1266
1266
1267
1267
cursor_mock .execute .assert_has_calls (
1268
1268
[
@@ -1722,7 +1722,7 @@ def columns(table_name):
1722
1722
snapshot .change_category = SnapshotChangeCategory .FORWARD_ONLY
1723
1723
1724
1724
with pytest .raises (NodeExecutionFailedError ) as ex :
1725
- evaluator .migrate ([snapshot ], {})
1725
+ evaluator .migrate ([snapshot ], {}, deployability_index = DeployabilityIndex . none_deployable () )
1726
1726
1727
1727
destructive_change_err = ex .value .__cause__
1728
1728
assert isinstance (destructive_change_err , DestructiveChangeError )
@@ -1744,15 +1744,20 @@ def columns(table_name):
1744
1744
1745
1745
logger = logging .getLogger ("sqlmesh.core.snapshot.evaluator" )
1746
1746
with patch .object (logger , "warning" ) as mock_logger :
1747
- evaluator .migrate ([snapshot ], {})
1747
+ evaluator .migrate ([snapshot ], {}, deployability_index = DeployabilityIndex . none_deployable () )
1748
1748
assert (
1749
1749
mock_logger .call_args [0 ][0 ]
1750
1750
== "\n Plan requires a destructive change to forward-only model '\" test_schema\" .\" test_model\" 's schema that drops column 'b'.\n \n Schema changes:\n ALTER TABLE sqlmesh__test_schema.test_schema__test_model__1 DROP COLUMN b\n ALTER TABLE sqlmesh__test_schema.test_schema__test_model__1 ADD COLUMN a INT"
1751
1751
)
1752
1752
1753
1753
# allow destructive
1754
1754
with patch .object (logger , "warning" ) as mock_logger :
1755
- evaluator .migrate ([snapshot ], {}, {'"test_schema"."test_model"' })
1755
+ evaluator .migrate (
1756
+ [snapshot ],
1757
+ {},
1758
+ {'"test_schema"."test_model"' },
1759
+ deployability_index = DeployabilityIndex .none_deployable (),
1760
+ )
1756
1761
assert mock_logger .call_count == 0
1757
1762
1758
1763
@@ -3638,7 +3643,7 @@ def test_migrate_snapshot(snapshot: Snapshot, mocker: MockerFixture, adapter_moc
3638
3643
assert new_snapshot .table_name () == snapshot .table_name ()
3639
3644
3640
3645
evaluator .create ([new_snapshot ], {})
3641
- evaluator .migrate ([new_snapshot ], {})
3646
+ evaluator .migrate ([new_snapshot ], {}, deployability_index = DeployabilityIndex . none_deployable () )
3642
3647
3643
3648
common_kwargs : t .Dict [str , t .Any ] = dict (
3644
3649
table_format = None ,
@@ -3706,7 +3711,11 @@ def test_migrate_managed(adapter_mock, make_snapshot, mocker: MockerFixture):
3706
3711
3707
3712
# no schema changes - no-op
3708
3713
adapter_mock .get_alter_expressions .return_value = []
3709
- evaluator .migrate (target_snapshots = [snapshot ], snapshots = {})
3714
+ evaluator .migrate (
3715
+ target_snapshots = [snapshot ],
3716
+ snapshots = {},
3717
+ deployability_index = DeployabilityIndex .none_deployable (),
3718
+ )
3710
3719
3711
3720
adapter_mock .create_table .assert_not_called ()
3712
3721
adapter_mock .create_managed_table .assert_not_called ()
@@ -3716,7 +3725,11 @@ def test_migrate_managed(adapter_mock, make_snapshot, mocker: MockerFixture):
3716
3725
adapter_mock .get_alter_expressions .return_value = [exp .Alter ()]
3717
3726
3718
3727
with pytest .raises (NodeExecutionFailedError ) as ex :
3719
- evaluator .migrate (target_snapshots = [snapshot ], snapshots = {})
3728
+ evaluator .migrate (
3729
+ target_snapshots = [snapshot ],
3730
+ snapshots = {},
3731
+ deployability_index = DeployabilityIndex .none_deployable (),
3732
+ )
3720
3733
3721
3734
sqlmesh_err = ex .value .__cause__
3722
3735
assert isinstance (sqlmesh_err , SQLMeshError )
@@ -3907,7 +3920,9 @@ def columns(table_name):
3907
3920
)
3908
3921
snapshot_2 = make_snapshot (model_2 , version = "1" )
3909
3922
snapshot_2 .change_category = SnapshotChangeCategory .FORWARD_ONLY
3910
- evaluator .migrate ([snapshot_1 , snapshot_2 ], {})
3923
+ evaluator .migrate (
3924
+ [snapshot_1 , snapshot_2 ], {}, deployability_index = DeployabilityIndex .none_deployable ()
3925
+ )
3911
3926
3912
3927
cursor_mock .execute .assert_has_calls (
3913
3928
[
0 commit comments