Skip to content

--execution-time param of CLI's audit command isn't working #5562

@makaroni4

Description

@makaroni4

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`                            

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