{"record":{"id":"6b4388dd38ed9a53","repo":"RyanCodrai/turbovec","slug":"please-provide-a-list-of-documents","errorCode":null,"errorMessage":"Please provide a list of Documents.","messagePattern":"Please provide a list of Documents\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"turbovec-python/python/turbovec/haystack.py","lineNumber":233,"sourceCode":"        else:\n            docs = [self._reconstruct(data) for data in list(self._u64_to_doc.values())]\n        # `return_embedding` is informational here — we never have the\n        # full-precision embedding to begin with. Kept for parity.\n        return docs\n\n    def write_documents(\n        self,\n        documents: List[Document],\n        policy: DuplicatePolicy = DuplicatePolicy.NONE,\n    ) -> int:\n        # Match InMemoryDocumentStore's input-shape validation rather\n        # than letting a bad input AttributeError on `.embedding`.\n        if (\n            not isinstance(documents, Iterable)\n            or isinstance(documents, str)\n            or any(not isinstance(doc, Document) for doc in documents)\n        ):\n            raise ValueError(\"Please provide a list of Documents.\")\n\n        if policy == DuplicatePolicy.NONE:\n            policy = DuplicatePolicy.FAIL\n\n        with self._write_lock:\n            return self._write_documents_locked(documents, policy)\n\n    def _write_documents_locked(\n        self, documents: List[Document], policy: DuplicatePolicy\n    ) -> int:\n        if policy == DuplicatePolicy.FAIL:\n            # Reference parity (issue #167): InMemoryDocumentStore commits\n            # each document as it iterates and raises on the *first*\n            # duplicate, so every non-duplicate document preceding it\n            # stays persisted — a partial write. Mirror that observable\n            # state exactly: validate and commit per document, raising on\n            # the first collision. A repeated id within a single call\n            # collides with its already-committed first instance, the same","sourceCodeStart":215,"sourceCodeEnd":251,"githubUrl":"https://github.com/RyanCodrai/turbovec/blob/ccab9f325e6ce2a270a87daf01ae4e443bcf2d49/turbovec-python/python/turbovec/haystack.py#L215-L251","documentation":"Raised in TurboQuantDocumentStore.write_documents when the input is not an iterable of haystack Document objects (e.g. a plain string, a single Document, or a list containing non-Document items). It mirrors InMemoryDocumentStore's input-shape validation, failing fast before any lock or mutation instead of an AttributeError on .embedding.","triggerScenarios":"Thrown at turbovec-python/python/turbovec/haystack.py:233 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a list of haystack Document instances, e.g. [Document(content=..., embedding=...)].","Validate the caller's pipeline output — upstream components may yield raw strings or dicts instead of Documents.","Catch the ValueError in ingestion code to give a clearer 'wrong input type' message."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ccab9f325e6ce2a270a87daf01ae4e443bcf2d49","analyzedAt":"2026-09-06T08:39:18.516Z","contentChangedAt":"2026-09-06T08:39:18.516Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}