From 0ab1f888fa26aac59edce65eb524bd76f52c30e8 Mon Sep 17 00:00:00 2001 From: Hyungi Ahn Date: Fri, 17 Apr 2026 08:20:46 +0900 Subject: [PATCH] =?UTF-8?q?fix(scripts):=20calibrate=5Fask.py=20SQL=20::ti?= =?UTF-8?q?mestamptz=20cast=20=ED=8C=8C=EC=8B=B1=20=EC=B6=A9=EB=8F=8C=20?= =?UTF-8?q?=ED=95=B4=EC=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SQLAlchemy text() 의 `:name` 파라미터가 PostgreSQL `::type` cast 와 토큰 경계 충돌로 치환되지 않아 `syntax error at or near ":"` 발생. `:since::timestamptz` → `CAST(:since AS TIMESTAMPTZ)` 로 변경. Reproduction: --since/--until 옵션 사용 시 모든 집계 쿼리 실패. Co-Authored-By: Claude Opus 4.7 (1M context) --- scripts/calibrate_ask.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/calibrate_ask.py b/scripts/calibrate_ask.py index 3ecdb13..6ca8582 100644 --- a/scripts/calibrate_ask.py +++ b/scripts/calibrate_ask.py @@ -109,8 +109,8 @@ def build_filters(args: argparse.Namespace) -> tuple[str, dict[str, Any]]: clauses = [ "(:source IS NULL OR source = :source)", "(:prompt_version IS NULL OR prompt_version = :prompt_version)", - "(:since IS NULL OR created_at >= :since::timestamptz)", - "(:until IS NULL OR created_at < :until::timestamptz)", + "(:since IS NULL OR created_at >= CAST(:since AS TIMESTAMPTZ))", + "(:until IS NULL OR created_at < CAST(:until AS TIMESTAMPTZ))", ] params: dict[str, Any] = { "source": args.source,