feat: add cron_tz to model_defaults by lafirm · Pull Request #5662 · SQLMesh/sqlmesh
Should fix #5661
Summary
Adds support for cron_tz in model_defaults, allowing users to set a default timezone for cron schedules at the project level and gateway level.
Changes
- Added
cron_tzfield toModelDefaultsConfigwith proper validation - Updated documentation to include
cron_tzin the list of supported model_defaults options - Added tests for both project-level and gateway-specific
cron_tzdefaults
Benefits
- DRY: No need to specify
cron_tzon every model when using a standard timezone - Gateway flexibility: Different environments can use different default timezones
- Consistency: Uses the same validation logic as model-level
cron_tz - Backward compatible: Existing configs without
cron_tzcontinue to work (defaults to UTC)
Example Usage
# Project-level default model_defaults: dialect: snowflake cron: '@daily' cron_tz: 'America/Los_Angeles' # Gateway-specific override gateways: production: connection: type: snowflake model_defaults: cron_tz: 'America/New_York'