Skip to content

Support cron_tz in model_defaults for project-wide timezone configurationΒ #5661

@lafirm

Description

@lafirm

Feature Request

Add support for cron_tz in the model_defaults section of config.yaml to allow setting a default timezone for all models in a project.

Use Case

In projects where all models use the same timezone for cron scheduling, it's repetitive and error-prone to specify the timezone in every individual model definition. A project-wide default would significantly reduce configuration duplication and maintenance overhead.

Current Behavior

Currently, cron_tz must be specified in each individual model's MODEL() definition:

MODEL (
  name my_schema.my_model,
  cron: '0 * * * *',
  cron_tz 'Europe/London',
);

When attempting to set it in model_defaults, SQLMesh returns an error:

Error: 'cron_tz' is not a valid model default configuration key.
Please remove it from the model_defaults specification in your config file.

Desired Behavior

Allow cron_tz to be specified in model_defaults:

model_defaults:
  dialect: trino
  start: '2025-01-01'
  kind: VIEW
  cron: '0 * * * *'
  cron_tz: 'Europe/London'  # Should be valid here
  interval_unit: 'hour'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions