Problem
When one runs an audit via sqlmesh CLI like so:
sqlmesh audit \
--execution-time "2025-10-24 19:18:09" \
--model XXX.YYY
execution macros like @execution_ds are set to 1970-01-01. Here's an audit query from the previous command
WITH `date_filtered` AS (
SELECT *
FROM `XXX`.`YYY`.`ZZZ` AS `ZZZ`
WHERE
SAFE_CAST(`publisher_date` AS DATE) > (DATE('1970-01-01')) -- DATE(@execution_ds) in the audit definition
)
SELECT *
FROM `date_filtered` AS `date_filtered`