diff --git a/metricflow/test/integration/test_configured_cases.py b/metricflow/test/integration/test_configured_cases.py index d9f69f9e67..1922eb132d 100644 --- a/metricflow/test/integration/test_configured_cases.py +++ b/metricflow/test/integration/test_configured_cases.py @@ -76,7 +76,12 @@ def render_between_time_constraint( start_time: str, stop_time: str, ) -> str: - """Render an expression like "ds between timestamp '2020-01-01' AND timestamp '2020-01-02'" since Trino require timestamp literals to be wrapped in a timestamp() function.""" + """Render an expression like "ds between timestamp '2020-01-01' AND timestamp '2020-01-02'". + + This will cast the literals as needed for each engine, and provide an alternative to incrementing + the date as we do in render_time_constraint. Using BETWEEN is more robust for cases involving potentially + mixed granularities. + """ start_expr = self.cast_to_ts(f"{start_time}") stop_expr = self.cast_to_ts(f"{stop_time}") return f"{expr} BETWEEN {start_expr} AND {stop_expr}"