@@ -2557,8 +2557,6 @@ def test_virtual_environment_mode_dev_only_model_kind_change(init_and_plan_conte
25572557 assert len (data_objects ) == 1
25582558 assert data_objects [0 ].type == "table"
25592559
2560- context .state_sync .clear_cache ()
2561-
25622560 # Change back to view
25632561 model = context .get_model ("sushi.top_waiters" )
25642562 model = model .copy (update = {"kind" : ViewKind ()})
@@ -2605,6 +2603,46 @@ def test_virtual_environment_mode_dev_only_model_kind_change(init_and_plan_conte
26052603 assert data_objects [0 ].type == "table"
26062604
26072605
2606+ @time_machine .travel ("2023-01-08 15:00:00 UTC" )
2607+ def test_virtual_environment_mode_dev_only_model_kind_change_manual_categorization (
2608+ init_and_plan_context : t .Callable ,
2609+ ):
2610+ context , plan = init_and_plan_context (
2611+ "examples/sushi" , config = "test_config_virtual_environment_mode_dev_only"
2612+ )
2613+ context .apply (plan )
2614+
2615+ model = context .get_model ("sushi.top_waiters" )
2616+ model = model .copy (update = {"kind" : FullKind ()})
2617+ context .upsert_model (model )
2618+ dev_plan_builder = context .plan_builder ("dev" , skip_tests = True , no_auto_categorization = True )
2619+ dev_plan_builder .set_choice (
2620+ dev_plan_builder ._context_diff .snapshots [context .get_snapshot (model .name ).snapshot_id ],
2621+ SnapshotChangeCategory .NON_BREAKING ,
2622+ )
2623+ dev_plan = dev_plan_builder .build ()
2624+ assert dev_plan .requires_backfill
2625+ assert len (dev_plan .missing_intervals ) == 1
2626+ context .apply (dev_plan )
2627+
2628+ prod_plan = context .plan_builder ("prod" , skip_tests = True ).build ()
2629+ assert prod_plan .requires_backfill
2630+ assert prod_plan .missing_intervals == [
2631+ SnapshotIntervals (
2632+ snapshot_id = context .get_snapshot ("sushi.top_waiters" ).snapshot_id ,
2633+ intervals = [
2634+ (to_timestamp ("2023-01-01" ), to_timestamp ("2023-01-02" )),
2635+ (to_timestamp ("2023-01-02" ), to_timestamp ("2023-01-03" )),
2636+ (to_timestamp ("2023-01-03" ), to_timestamp ("2023-01-04" )),
2637+ (to_timestamp ("2023-01-04" ), to_timestamp ("2023-01-05" )),
2638+ (to_timestamp ("2023-01-05" ), to_timestamp ("2023-01-06" )),
2639+ (to_timestamp ("2023-01-06" ), to_timestamp ("2023-01-07" )),
2640+ (to_timestamp ("2023-01-07" ), to_timestamp ("2023-01-08" )),
2641+ ],
2642+ ),
2643+ ]
2644+
2645+
26082646@time_machine .travel ("2023-01-08 15:00:00 UTC" )
26092647def test_restatement_plan_ignores_changes (init_and_plan_context : t .Callable ):
26102648 context , plan = init_and_plan_context ("examples/sushi" )
0 commit comments