Skip to content

Commit 06c2ac1

Browse files
committed
try again
1 parent e7328c5 commit 06c2ac1

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

store/backend/manage.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,14 @@ def backfill_note_keys(limit, dry_run):
142142
if inferred:
143143
updated += 1
144144
if not dry_run:
145-
conn.execute(
146-
sa.text("UPDATE annotations SET note_keys = :note_keys WHERE id = :id"),
147-
{"id": annot_id, "note_keys": inferred},
145+
payload = {k: v for k, v in inferred.items()}
146+
stmt = sa.text(
147+
"UPDATE annotations SET note_keys = :note_keys WHERE id = :id"
148+
).bindparams(
149+
sa.bindparam("note_keys", type_=sa.JSON),
150+
sa.bindparam("id"),
148151
)
152+
conn.execute(stmt, {"id": annot_id, "note_keys": payload})
149153

150154
if updated and not dry_run:
151155
db.session.commit()

0 commit comments

Comments
 (0)