From 5597e864d578b3f27c79b647a730a0ea80df88af Mon Sep 17 00:00:00 2001 From: Hashwanth S Date: Thu, 2 Apr 2026 01:19:02 -0700 Subject: [PATCH] fix: prevent 'value' identifier corruption in SQL evaluation Replace naive p_str.replace("value", "1") with quoted-only replacements that target SQL string literal placeholders ('value' and "value") instead of bare identifiers. This prevents column names like `value` in databases such as warehouse_1 from being corrupted during evaluation. --- evaluation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evaluation.py b/evaluation.py index fae509c..0c4394e 100644 --- a/evaluation.py +++ b/evaluation.py @@ -566,7 +566,7 @@ def evaluate(gold, predict, db_dir, etype, kmaps, plug_value, keep_distinct, pro for idx, pg in enumerate(zip(p, g)): p, g = pg p_str = p[0] - p_str = p_str.replace("value", "1") + p_str = p_str.replace("'value'", "'1'").replace('"value"', '"1"') g_str, db = g db_name = db db = os.path.join(db_dir, db, db + ".sqlite")