@@ -2505,76 +2505,22 @@ def test_virtual_environment_mode_dev_only(init_and_plan_context: t.Callable):
25052505 )[0 ]
25062506 assert min_event_date == to_date ("2023-01-07" )
25072507
2508- # Make sure the changed models are fully rebuilt when deploying to prod
2508+ # Make sure the changes are applied without backfill in prod
25092509 plan_prod = context .plan_builder ("prod" ).build ()
2510- assert plan_prod .requires_backfill
2511- assert plan_prod .missing_intervals == [
2512- SnapshotIntervals (
2513- snapshot_id = context .get_snapshot ("sushi.top_waiters" ).snapshot_id ,
2514- intervals = [
2515- (to_timestamp ("2023-01-01" ), to_timestamp ("2023-01-02" )),
2516- (to_timestamp ("2023-01-02" ), to_timestamp ("2023-01-03" )),
2517- (to_timestamp ("2023-01-03" ), to_timestamp ("2023-01-04" )),
2518- (to_timestamp ("2023-01-04" ), to_timestamp ("2023-01-05" )),
2519- (to_timestamp ("2023-01-05" ), to_timestamp ("2023-01-06" )),
2520- (to_timestamp ("2023-01-06" ), to_timestamp ("2023-01-07" )),
2521- (to_timestamp ("2023-01-07" ), to_timestamp ("2023-01-08" )),
2522- ],
2523- ),
2524- SnapshotIntervals (
2525- snapshot_id = context .get_snapshot ("sushi.waiter_revenue_by_day" ).snapshot_id ,
2526- intervals = [
2527- (to_timestamp ("2023-01-01" ), to_timestamp ("2023-01-02" )),
2528- (to_timestamp ("2023-01-02" ), to_timestamp ("2023-01-03" )),
2529- (to_timestamp ("2023-01-03" ), to_timestamp ("2023-01-04" )),
2530- (to_timestamp ("2023-01-04" ), to_timestamp ("2023-01-05" )),
2531- (to_timestamp ("2023-01-05" ), to_timestamp ("2023-01-06" )),
2532- (to_timestamp ("2023-01-06" ), to_timestamp ("2023-01-07" )),
2533- (to_timestamp ("2023-01-07" ), to_timestamp ("2023-01-08" )),
2534- ],
2535- ),
2536- ]
2510+ assert not plan_prod .requires_backfill
2511+ assert not plan_prod .missing_intervals
25372512 context .apply (plan_prod )
25382513 assert "one" in context .engine_adapter .columns ("sushi.waiter_revenue_by_day" )
2539- assert (
2540- context .engine_adapter .fetchone (
2541- "SELECT COUNT(*) FROM sushi.waiter_revenue_by_day WHERE one is NULL"
2542- )[0 ]
2543- == 0
2544- )
25452514
25462515 # Make sure the revert of a breaking changes results in a full rebuild
25472516 context .upsert_model (original_model )
25482517 assert context .get_snapshot (original_model .name ).fingerprint == original_fingerprint
25492518
2550- plan_prod = context .plan_builder ("prod" ).build ()
2551- assert plan_prod .requires_backfill
2552- assert plan_prod .missing_intervals == [
2553- SnapshotIntervals (
2554- snapshot_id = context .get_snapshot ("sushi.top_waiters" ).snapshot_id ,
2555- intervals = [
2556- (to_timestamp ("2023-01-01" ), to_timestamp ("2023-01-02" )),
2557- (to_timestamp ("2023-01-02" ), to_timestamp ("2023-01-03" )),
2558- (to_timestamp ("2023-01-03" ), to_timestamp ("2023-01-04" )),
2559- (to_timestamp ("2023-01-04" ), to_timestamp ("2023-01-05" )),
2560- (to_timestamp ("2023-01-05" ), to_timestamp ("2023-01-06" )),
2561- (to_timestamp ("2023-01-06" ), to_timestamp ("2023-01-07" )),
2562- (to_timestamp ("2023-01-07" ), to_timestamp ("2023-01-08" )),
2563- ],
2564- ),
2565- SnapshotIntervals (
2566- snapshot_id = context .get_snapshot ("sushi.waiter_revenue_by_day" ).snapshot_id ,
2567- intervals = [
2568- (to_timestamp ("2023-01-01" ), to_timestamp ("2023-01-02" )),
2569- (to_timestamp ("2023-01-02" ), to_timestamp ("2023-01-03" )),
2570- (to_timestamp ("2023-01-03" ), to_timestamp ("2023-01-04" )),
2571- (to_timestamp ("2023-01-04" ), to_timestamp ("2023-01-05" )),
2572- (to_timestamp ("2023-01-05" ), to_timestamp ("2023-01-06" )),
2573- (to_timestamp ("2023-01-06" ), to_timestamp ("2023-01-07" )),
2574- (to_timestamp ("2023-01-07" ), to_timestamp ("2023-01-08" )),
2575- ],
2576- ),
2577- ]
2519+ plan_prod = context .plan_builder (
2520+ "prod" , allow_destructive_models = ["sushi.waiter_revenue_by_day" ]
2521+ ).build ()
2522+ assert not plan_prod .requires_backfill
2523+ assert not plan_prod .missing_intervals
25782524 context .apply (plan_prod )
25792525 assert "one" not in context .engine_adapter .columns ("sushi.waiter_revenue_by_day" )
25802526
0 commit comments