@@ -125,7 +125,11 @@ def test_create_plan_dag_spec(
125125 state_sync_mock .get_environment .return_value = old_environment
126126 state_sync_mock .get_snapshot_intervals .return_value = []
127127
128- plan_spec = create_plan_dag_spec (plan_request , state_sync_mock )
128+ with mock .patch (
129+ "sqlmesh.schedulers.airflow.plan.now_timestamp" ,
130+ side_effect = lambda : to_timestamp ("2023-01-01" ),
131+ ):
132+ plan_spec = create_plan_dag_spec (plan_request , state_sync_mock )
129133 assert plan_spec == common .PlanDagSpec (
130134 request_id = "test_request_id" ,
131135 environment_naming_info = EnvironmentNamingInfo (
@@ -152,6 +156,7 @@ def test_create_plan_dag_spec(
152156 users = [],
153157 is_dev = False ,
154158 forward_only = True ,
159+ dag_start_ts = to_timestamp ("2023-01-01" ),
155160 )
156161
157162 state_sync_mock .get_snapshots .assert_called_once ()
@@ -240,9 +245,11 @@ def test_restatement(
240245 dev_intervals = [],
241246 )
242247 ]
248+ now_value = "2022-01-09T23:59:59+00:00"
243249 with mock .patch (
244- "sqlmesh.schedulers.airflow.plan.now" ,
245- side_effect = lambda : to_datetime ("2022-01-09T23:59:59+00:00" ),
250+ "sqlmesh.schedulers.airflow.plan.now" , side_effect = lambda : to_datetime (now_value )
251+ ), mock .patch (
252+ "sqlmesh.schedulers.airflow.plan.now_timestamp" , side_effect = lambda : to_timestamp (now_value )
246253 ):
247254 plan_spec = create_plan_dag_spec (plan_request , state_sync_mock )
248255 assert plan_spec == common .PlanDagSpec (
@@ -271,6 +278,7 @@ def test_restatement(
271278 users = [],
272279 is_dev = False ,
273280 forward_only = True ,
281+ dag_start_ts = to_timestamp (now_value ),
274282 )
275283
276284 state_sync_mock .get_snapshots .assert_called_once ()
0 commit comments