From 1fa9930d417a2858ec00cab2bb050c5bd1e69610 Mon Sep 17 00:00:00 2001 From: Aakash Kattelu Date: Wed, 26 Aug 2026 16:54:25 -0400 Subject: [PATCH] fix: preserve pgvector None sentinel on zero top_k query_external_vector_document_ids must return None when on the pgvector path before applying the top_k<=0 empty-list guard. --- src/crud/document.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/crud/document.py b/src/crud/document.py index dd9a3f46..37eb94b4 100644 --- a/src/crud/document.py +++ b/src/crud/document.py @@ -228,12 +228,12 @@ async def query_external_vector_document_ids( empty list when the external store has no results, or None when the pgvector (DB-only) path should be used instead. """ - if top_k <= 0: - return [] - if _uses_pgvector(): return None + if top_k <= 0: + return [] + external_vector_store = get_external_vector_store() if external_vector_store is None: return []