From 2daf084eb6f02c6985ef0686556148845d28974c Mon Sep 17 00:00:00 2001 From: sarbmeetka Date: Wed, 22 Nov 2023 14:43:29 -0700 Subject: [PATCH] Address function inline comments --- metricflow/test/integration/test_configured_cases.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/metricflow/test/integration/test_configured_cases.py b/metricflow/test/integration/test_configured_cases.py index 6c5ded8df6..b35c0ef91b 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}"