99
1010
1111@pytest .fixture
12- def scheduler (sushi_context_pre_scheduling : Context ) -> Scheduler :
13- return sushi_context_pre_scheduling .scheduler ()
12+ def scheduler (sushi_context_fixed_date : Context ) -> Scheduler :
13+ return sushi_context_fixed_date .scheduler ()
1414
1515
1616@pytest .fixture
17- def orders (sushi_context_pre_scheduling : Context ) -> Snapshot :
18- return sushi_context_pre_scheduling .snapshots ["sushi.orders" ]
17+ def orders (sushi_context_fixed_date : Context ) -> Snapshot :
18+ return sushi_context_fixed_date .snapshots ["sushi.orders" ]
1919
2020
21- def test_interval_params (
22- scheduler : Scheduler , sushi_context_pre_scheduling : Context , orders : Snapshot
23- ):
24- waiter_revenue = sushi_context_pre_scheduling .snapshots ["sushi.waiter_revenue_by_day" ]
21+ def test_interval_params (scheduler : Scheduler , sushi_context_fixed_date : Context , orders : Snapshot ):
22+ waiter_revenue = sushi_context_fixed_date .snapshots ["sushi.waiter_revenue_by_day" ]
2523 start_ds = "2022-01-01"
2624 end_ds = "2022-02-05"
2725 assert scheduler ._interval_params ([orders , waiter_revenue ], start_ds , end_ds ) == {
@@ -53,8 +51,8 @@ def test_interval_params_nonconsecutive(scheduler: Scheduler, orders: Snapshot):
5351 }
5452
5553
56- def test_interval_params_missing (scheduler : Scheduler , sushi_context_pre_scheduling : Context ):
57- waiters = sushi_context_pre_scheduling .snapshots ["sushi.waiter_as_customer_by_day" ]
54+ def test_interval_params_missing (scheduler : Scheduler , sushi_context_fixed_date : Context ):
55+ waiters = sushi_context_fixed_date .snapshots ["sushi.waiter_as_customer_by_day" ]
5856
5957 start_ds = "2022-01-01"
6058 end_ds = "2022-03-01"
@@ -66,34 +64,34 @@ def test_interval_params_missing(scheduler: Scheduler, sushi_context_pre_schedul
6664
6765
6866def test_multi_version_snapshots (
69- sushi_context_pre_scheduling : Context , scheduler : Scheduler , make_snapshot
67+ sushi_context_fixed_date : Context , scheduler : Scheduler , make_snapshot
7068):
7169 start_ds = "2022-01-01"
7270 end_ds = "2022-02-05"
7371
74- model = sushi_context_pre_scheduling .models ["sushi.waiter_as_customer_by_day" ]
72+ model = sushi_context_fixed_date .models ["sushi.waiter_as_customer_by_day" ]
7573
7674 items_a = make_snapshot (
7775 model ,
78- models = sushi_context_pre_scheduling .models ,
76+ models = sushi_context_fixed_date .models ,
7977 version = "1" ,
8078 )
8179 items_a .fingerprint = SnapshotFingerprint (data_hash = "data" , metadata_hash = "metadata" )
8280 items_a .add_interval ("2022-01-10" , "2022-01-15" )
83- sushi_context_pre_scheduling .state_sync .push_snapshots ([items_a ])
81+ sushi_context_fixed_date .state_sync .push_snapshots ([items_a ])
8482
85- model = sushi_context_pre_scheduling .upsert_model (
83+ model = sushi_context_fixed_date .upsert_model (
8684 model ,
8785 query = parse_one ("SELECT 1::INT, '2022-01-01'::TEXT AS ds" ),
8886 )
8987
9088 items_b = make_snapshot (
9189 model ,
92- models = sushi_context_pre_scheduling .models ,
90+ models = sushi_context_fixed_date .models ,
9391 version = "1" ,
9492 )
9593 items_b .add_interval ("2022-01-20" , "2022-01-25" )
96- sushi_context_pre_scheduling .state_sync .push_snapshots ([items_b ])
94+ sushi_context_fixed_date .state_sync .push_snapshots ([items_b ])
9795
9896 interval_params = scheduler ._interval_params ([items_a ], start_ds , end_ds )
9997 assert len (interval_params ) == 1
@@ -113,9 +111,9 @@ def test_multi_version_snapshots(
113111 ]
114112
115113
116- def test_run (sushi_context_pre_scheduling : Context , scheduler : Scheduler ):
117- adapter = sushi_context_pre_scheduling .engine_adapter
118- snapshot = sushi_context_pre_scheduling .snapshots ["sushi.items" ]
114+ def test_run (sushi_context_fixed_date : Context , scheduler : Scheduler ):
115+ adapter = sushi_context_fixed_date .engine_adapter
116+ snapshot = sushi_context_fixed_date .snapshots ["sushi.items" ]
119117 scheduler .run (
120118 c .PROD ,
121119 "2022-01-01" ,
0 commit comments