fix(llm): theme stamping issues its batch UPDATE through Connection.execute with a params list (Connection has no executemany)
Some checks failed
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled
CI / notebooks-smoke (push) Has been cancelled
Deploy / notebooks (push) Has been cancelled
Deploy / docs (push) Has been cancelled
Deploy / api (push) Has been cancelled
Deploy / llm (push) Has been cancelled
Deploy / mc (push) Has been cancelled
Deploy / report (push) Has been cancelled
Infra CI / notebooks (push) Has been cancelled
Infra CI / zotero (push) Has been cancelled
Infra CI / docs (push) Has been cancelled
Infra CI / api (push) Has been cancelled
Infra CI / llm (push) Has been cancelled
Infra CI / mc (push) Has been cancelled
Deploy / zotero (push) Has been cancelled
Some checks failed
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled
CI / notebooks-smoke (push) Has been cancelled
Deploy / notebooks (push) Has been cancelled
Deploy / docs (push) Has been cancelled
Deploy / api (push) Has been cancelled
Deploy / llm (push) Has been cancelled
Deploy / mc (push) Has been cancelled
Deploy / report (push) Has been cancelled
Infra CI / notebooks (push) Has been cancelled
Infra CI / zotero (push) Has been cancelled
Infra CI / docs (push) Has been cancelled
Infra CI / api (push) Has been cancelled
Infra CI / llm (push) Has been cancelled
Infra CI / mc (push) Has been cancelled
Deploy / zotero (push) Has been cancelled
This commit is contained in:
@@ -140,7 +140,7 @@ def stamp(
|
||||
patches.append({"id": cid, "patch": json.dumps(patch)})
|
||||
if patches:
|
||||
with engine.begin() as conn:
|
||||
conn.executemany(text(_UPDATE), patches)
|
||||
conn.execute(text(_UPDATE), patches) # a list of params = executemany
|
||||
stats["stamped"] += len(patches)
|
||||
log.info("themes: scanned=%d stamped=%d", stats["scanned"], stats["stamped"])
|
||||
return stats
|
||||
|
||||
@@ -34,13 +34,10 @@ def _engine(pages):
|
||||
r = MagicMock()
|
||||
r.fetchall.return_value = selects.pop(0)
|
||||
return r
|
||||
updates.extend(params) # an UPDATE with a list of params (executemany)
|
||||
return MagicMock()
|
||||
|
||||
def executemany(sql, params):
|
||||
updates.extend(params)
|
||||
|
||||
conn.execute.side_effect = execute
|
||||
conn.executemany.side_effect = executemany
|
||||
return engine, updates
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user