From 200facda6a6d7a54e11a5803e87f25cfb96d1ebc Mon Sep 17 00:00:00 2001 From: Benjamin Admin Date: Tue, 24 Mar 2026 08:48:58 +0100 Subject: [PATCH] fix: use CAST(:dd AS jsonb) instead of :dd::jsonb in _write_review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SQLAlchemy's text() parser doesn't properly handle :param::type syntax — it fails to recognize :dd as a bind parameter when followed by ::jsonb. Using CAST(:dd AS jsonb) instead. Co-Authored-By: Claude Opus 4.6 --- backend-compliance/compliance/services/batch_dedup_runner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend-compliance/compliance/services/batch_dedup_runner.py b/backend-compliance/compliance/services/batch_dedup_runner.py index 89ccfe8..720f6b7 100644 --- a/backend-compliance/compliance/services/batch_dedup_runner.py +++ b/backend-compliance/compliance/services/batch_dedup_runner.py @@ -578,7 +578,7 @@ class BatchDedupRunner: matched_control_uuid, matched_control_id, similarity_score, dedup_stage, dedup_details) VALUES (:ccid, :ct, :co, CAST(:mcu AS uuid), :mci, - :ss, 'batch_dedup', :dd::jsonb) + :ss, 'batch_dedup', CAST(:dd AS jsonb)) """), { "ccid": candidate["control_id"], "ct": candidate["title"],