Skip to content

Commit ae94de8

Browse files
PRAteek-singHWYnorthdpole
authored andcommitted
week_3: address review — warn loudly when pgvector backend runs on non-Postgres
Maintainer nit on #937: CRE_LIBRARIAN_RETRIEVER_BACKEND=pgvector is selectable via env, but the embedding_vec column doesn't land until W8. Emit a loud startup warning at pipeline-switch time when the backend is pgvector on a non-Postgres (e.g. SQLite) database, since retrieve() would otherwise fail with an opaque SQL error.
1 parent e7420cf commit ae94de8

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

application/cmd/cre_main.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,6 +1105,16 @@ def run_librarian(
11051105
ph = prompt_client.PromptHandler(database=database)
11061106

11071107
backend = RetrieverBackend(cfg.retriever_backend)
1108+
if backend is RetrieverBackend.pgvector:
1109+
dialect = database.session.connection().dialect.name
1110+
if dialect != "postgresql":
1111+
logger.warning(
1112+
"CRE_LIBRARIAN_RETRIEVER_BACKEND=pgvector selected on a %r "
1113+
"database, but the pgvector backend needs Postgres with the "
1114+
"embedding_vec column (lands W8) and will fail at retrieve() "
1115+
"time here. Set the backend to in_memory until then.",
1116+
dialect,
1117+
)
11081118
# The CRE ids present in the hub are exactly the known ids the explicit
11091119
# resolver may auto-link to (W2 seeded this from the golden set; here it is
11101120
# the real DB-backed registry).

0 commit comments

Comments
 (0)