@@ -3359,3 +3359,64 @@ def test_environment_statements_change_allows_dev_environment_creation(make_snap
33593359 assert plan is not None
33603360 assert plan .context_diff .has_environment_statements_changes
33613361 assert plan .context_diff .environment_statements == environment_statements
3362+
3363+
3364+ def test_plan_ignore_cron_flag (make_snapshot ):
3365+ snapshot_a = make_snapshot (
3366+ SqlModel (
3367+ name = "test_model" ,
3368+ kind = IncrementalByTimeRangeKind (time_column = "ds" ),
3369+ cron = "@daily" , # Daily cron schedule
3370+ start = "2023-01-01" ,
3371+ query = parse_one ("SELECT 1 as id, ds FROM VALUES ('2023-01-01') t(ds)" ),
3372+ allow_partials = True ,
3373+ )
3374+ )
3375+ snapshot_a .categorize_as (SnapshotChangeCategory .BREAKING , forward_only = False )
3376+
3377+ context_diff = ContextDiff (
3378+ environment = "dev" ,
3379+ is_new_environment = True ,
3380+ is_unfinalized_environment = False ,
3381+ normalize_environment_name = True ,
3382+ create_from = "prod" ,
3383+ create_from_env_exists = True ,
3384+ added = set (),
3385+ removed_snapshots = {},
3386+ modified_snapshots = {},
3387+ snapshots = {snapshot_a .snapshot_id : snapshot_a },
3388+ new_snapshots = {snapshot_a .snapshot_id : snapshot_a },
3389+ previous_plan_id = None ,
3390+ previously_promoted_snapshot_ids = set (),
3391+ previous_finalized_snapshots = None ,
3392+ previous_gateway_managed_virtual_layer = False ,
3393+ gateway_managed_virtual_layer = False ,
3394+ environment_statements = [],
3395+ )
3396+
3397+ plan_builder_ignore_cron = PlanBuilder (
3398+ context_diff ,
3399+ start = "2023-01-01" ,
3400+ execution_time = "2023-01-05 12:00:00" ,
3401+ is_dev = True ,
3402+ include_unmodified = True ,
3403+ ignore_cron = True ,
3404+ end_bounded = False ,
3405+ )
3406+
3407+ plan = plan_builder_ignore_cron .build ()
3408+ assert plan .ignore_cron is True
3409+ assert plan .to_evaluatable ().ignore_cron is True
3410+
3411+ assert plan .missing_intervals == [
3412+ SnapshotIntervals (
3413+ snapshot_id = snapshot_a .snapshot_id ,
3414+ intervals = [
3415+ (to_timestamp ("2023-01-01" ), to_timestamp ("2023-01-02" )),
3416+ (to_timestamp ("2023-01-02" ), to_timestamp ("2023-01-03" )),
3417+ (to_timestamp ("2023-01-03" ), to_timestamp ("2023-01-04" )),
3418+ (to_timestamp ("2023-01-04" ), to_timestamp ("2023-01-05" )),
3419+ (to_timestamp ("2023-01-05" ), to_timestamp ("2023-01-05 12:00:00" )),
3420+ ],
3421+ )
3422+ ]
0 commit comments