From 5b5bac42fb9c83a8e02124e6429a3012b295cb8c Mon Sep 17 00:00:00 2001 From: KoalaTrapLord <265133236+KoalaTrapLord@users.noreply.github.com> Date: Mon, 30 Mar 2026 10:39:49 -0400 Subject: [PATCH] fix: use vars(row) instead of dict(row) in _build_collection_from_bulk dict() on a types.SimpleNamespace raises TypeError: object is not iterable. vars() correctly extracts the __dict__ attribute map. Fixes TestBuildCollectionFailureTracking::test_high_failure_rate_raises_runtime_error. --- services/rag_store.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/rag_store.py b/services/rag_store.py index 015b874..f9a1dcf 100644 --- a/services/rag_store.py +++ b/services/rag_store.py @@ -290,7 +290,8 @@ def _build_collection_from_bulk(batch_size: int = DEFAULT_BATCH_SIZE) -> dict: batch_docs: list[str] = [] batch_metas: list[dict] = [] for row in all_rows: - card = dict(row) + # Support both sqlite3.Row (supports dict()) and SimpleNamespace (needs vars()) + card = dict(row) if hasattr(row, "keys") else vars(row) doc = _build_document(card) if not doc.strip(): continue