@@ -4049,6 +4049,32 @@ def test_plan_repairs_unrenderable_snapshot_state(
40494049 assert target_snapshot_in_state .model .render_query_or_raise ()
40504050
40514051
4052+ @time_machine .travel ("2023-01-08 15:00:00 UTC" )
4053+ def test_no_backfill_for_model_downstream_of_metadata_change (init_and_plan_context : t .Callable ):
4054+ context , _ = init_and_plan_context ("examples/sushi" )
4055+
4056+ # Make sushi.waiter_revenue_by_day a forward-only model.
4057+ forward_only_model = context .get_model ("sushi.waiter_revenue_by_day" )
4058+ updated_model_kind = forward_only_model .kind .copy (update = {"forward_only" : True })
4059+ forward_only_model = forward_only_model .copy (update = {"kind" : updated_model_kind })
4060+ context .upsert_model (forward_only_model )
4061+
4062+ context .plan ("prod" , auto_apply = True , no_prompts = True , skip_tests = True )
4063+
4064+ # Make a metadata change upstream of the forward-only model.
4065+ context .upsert_model ("sushi.orders" , owner = "new_owner" )
4066+
4067+ plan = context .plan_builder ("test_dev" ).build ()
4068+ assert plan .has_changes
4069+ assert not plan .directly_modified
4070+ assert not plan .indirectly_modified
4071+ assert not plan .missing_intervals
4072+ assert all (
4073+ snapshot .change_category == SnapshotChangeCategory .METADATA
4074+ for snapshot in plan .new_snapshots
4075+ )
4076+
4077+
40524078@time_machine .travel ("2023-01-08 15:00:00 UTC" )
40534079def test_dbt_requirements (sushi_dbt_context : Context ):
40544080 assert set (sushi_dbt_context .requirements ) == {"dbt-core" , "dbt-duckdb" }
0 commit comments