File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1328,6 +1328,9 @@ def plan_builder(
13281328 ),
13291329 )
13301330
1331+ # Refresh snapshot intervals to ensure that they are up to date with values reflected in the max_interval_end_per_model.
1332+ self .state_sync .refresh_snapshot_intervals (context_diff .snapshots .values ())
1333+
13311334 return self .PLAN_BUILDER_TYPE (
13321335 context_diff = context_diff ,
13331336 start = start ,
Original file line number Diff line number Diff line change @@ -780,15 +780,18 @@ def test_restate_models(sushi_context_pre_scheduling: Context):
780780
781781
782782@pytest .mark .slow
783- @time_machine .travel (now (), tick = False )
784- def test_restate_models_with_existing_missing_intervals (sushi_context : Context ):
783+ @time_machine .travel (now (minute_floor = False ), tick = False )
784+ def test_restate_models_with_existing_missing_intervals (init_and_plan_context : t .Callable ):
785+ sushi_context , plan = init_and_plan_context ("examples/sushi" )
786+ sushi_context .apply (plan )
787+
785788 yesterday_ts = to_timestamp (yesterday_ds ())
786789
787790 assert not sushi_context .plan (no_prompts = True ).requires_backfill
788791 waiter_revenue_by_day = sushi_context .snapshots ['"memory"."sushi"."waiter_revenue_by_day"' ]
789- waiter_revenue_by_day . intervals = [
790- (waiter_revenue_by_day .intervals [0 ][0 ], yesterday_ts ),
791- ]
792+ sushi_context . state_sync . remove_intervals (
793+ [ (waiter_revenue_by_day , ( yesterday_ts , waiter_revenue_by_day .intervals [0 ][1 ]))]
794+ )
792795 assert sushi_context .plan (no_prompts = True ).requires_backfill
793796
794797 plan = sushi_context .plan (restate_models = ["sushi.waiter_revenue_by_day" ], no_prompts = True )
You can’t perform that action at this time.
0 commit comments