@@ -1211,93 +1211,6 @@ def test_build_plan_stages_environment_suffix_target_changed(
12111211 )
12121212
12131213
1214- def test_build_plan_stages_indirect_non_breaking_no_migration (
1215- snapshot_a : Snapshot , snapshot_b : Snapshot , make_snapshot , mocker : MockerFixture
1216- ) -> None :
1217- # Categorize snapshot_a as forward-only
1218- new_snapshot_a = make_snapshot (
1219- snapshot_a .model .copy (update = {"stamp" : "new_version" }),
1220- )
1221- new_snapshot_a .previous_versions = snapshot_a .all_versions
1222- new_snapshot_a .categorize_as (SnapshotChangeCategory .NON_BREAKING )
1223-
1224- new_snapshot_b = make_snapshot (
1225- snapshot_b .model .copy (),
1226- nodes = {'"a"' : new_snapshot_a .model },
1227- )
1228- new_snapshot_b .previous_versions = snapshot_b .all_versions
1229- new_snapshot_b .change_category = SnapshotChangeCategory .INDIRECT_NON_BREAKING
1230- new_snapshot_b .version = new_snapshot_b .previous_version .data_version .version
1231-
1232- state_reader = mocker .Mock (spec = StateReader )
1233- state_reader .get_snapshots .return_value = {}
1234- existing_environment = Environment (
1235- name = "prod" ,
1236- snapshots = [snapshot_a .table_info , snapshot_b .table_info ],
1237- start_at = "2023-01-01" ,
1238- end_at = "2023-01-02" ,
1239- plan_id = "previous_plan" ,
1240- previous_plan_id = None ,
1241- promoted_snapshot_ids = [snapshot_a .snapshot_id , snapshot_b .snapshot_id ],
1242- finalized_ts = to_timestamp ("2023-01-02" ),
1243- )
1244- state_reader .get_environment .return_value = existing_environment
1245-
1246- # Create environment
1247- environment = Environment (
1248- name = "prod" ,
1249- snapshots = [new_snapshot_a .table_info , new_snapshot_b .table_info ],
1250- start_at = "2023-01-01" ,
1251- end_at = "2023-01-02" ,
1252- plan_id = "test_plan" ,
1253- previous_plan_id = "previous_plan" ,
1254- promoted_snapshot_ids = [new_snapshot_a .snapshot_id , new_snapshot_b .snapshot_id ],
1255- )
1256-
1257- # Create evaluatable plan
1258- plan = EvaluatablePlan (
1259- start = "2023-01-01" ,
1260- end = "2023-01-02" ,
1261- new_snapshots = [new_snapshot_a , new_snapshot_b ],
1262- environment = environment ,
1263- no_gaps = False ,
1264- skip_backfill = False ,
1265- empty_backfill = False ,
1266- restatements = {},
1267- is_dev = False ,
1268- allow_destructive_models = set (),
1269- forward_only = False ,
1270- end_bounded = False ,
1271- ensure_finalized_snapshots = False ,
1272- directly_modified_snapshots = [new_snapshot_a .snapshot_id ],
1273- indirectly_modified_snapshots = {
1274- new_snapshot_a .name : [new_snapshot_b .snapshot_id ],
1275- },
1276- metadata_updated_snapshots = [],
1277- removed_snapshots = [],
1278- requires_backfill = True ,
1279- models_to_backfill = None ,
1280- execution_time = "2023-01-02" ,
1281- disabled_restatement_models = set (),
1282- environment_statements = None ,
1283- user_provided_flags = None ,
1284- )
1285-
1286- # Build plan stages
1287- stages = build_plan_stages (plan , state_reader , None )
1288-
1289- # Verify stages
1290- assert len (stages ) == 7
1291-
1292- assert isinstance (stages [0 ], CreateSnapshotRecordsStage )
1293- assert isinstance (stages [1 ], PhysicalLayerUpdateStage )
1294- assert isinstance (stages [2 ], BackfillStage )
1295- assert isinstance (stages [3 ], EnvironmentRecordUpdateStage )
1296- assert isinstance (stages [4 ], UnpauseStage )
1297- assert isinstance (stages [5 ], VirtualLayerUpdateStage )
1298- assert isinstance (stages [6 ], FinalizeEnvironmentStage )
1299-
1300-
13011214def test_build_plan_stages_indirect_non_breaking_view_migration (
13021215 snapshot_a : Snapshot , snapshot_c : Snapshot , make_snapshot , mocker : MockerFixture
13031216) -> None :
0 commit comments