{"record":{"id":"9092a8107d7cdeb1","repo":"MemPalace/mempalace","slug":"update-requires-at-least-one-of-documents-metadat-9092a8","errorCode":null,"errorMessage":"update requires at least one of documents, metadatas, embeddings","messagePattern":"update requires at least one of documents, metadatas, embeddings","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"mempalace/backends/pgvector.py","lineNumber":997,"sourceCode":"        vectors, dimension = _normalize_vectors(embeddings)\n        self._ensure_table(dimension)\n        metadatas = metadatas or [{} for _ in ids]\n        rows = [\n            {\n                \"id\": str(doc_id),\n                \"document\": str(doc),\n                \"metadata\": _jsonable_metadata(meta),\n                \"embedding\": vector,\n                \"updated_at\": _utcnow(),\n            }\n            for doc_id, doc, meta, vector in zip(ids, documents, metadatas, vectors)\n        ]\n        self._client.upsert_rows(self._table, rows)\n        self._backend._write_marker(self._palace, self._config)\n\n    def update(self, *, ids, documents=None, metadatas=None, embeddings=None):\n        if documents is None and metadatas is None and embeddings is None:\n            raise ValueError(\"update requires at least one of documents, metadatas, embeddings\")\n        n = len(ids)\n        for label, value in (\n            (\"documents\", documents),\n            (\"metadatas\", metadatas),\n            (\"embeddings\", embeddings),\n        ):\n            if value is not None and len(value) != n:\n                raise ValueError(f\"{label} length {len(value)} does not match ids length {n}\")\n        existing = self.get(ids=ids, include=[\"documents\", \"metadatas\", \"embeddings\"])\n        by_id = {\n            rid: (existing.documents[i], existing.metadatas[i], existing.embeddings[i])\n            for i, rid in enumerate(existing.ids)\n            if existing.embeddings is not None\n        }\n        out_ids, out_docs, out_metas, out_embeddings = [], [], [], []\n        for idx, doc_id in enumerate(ids):\n            if doc_id not in by_id:\n                continue","sourceCodeStart":979,"sourceCodeEnd":1015,"githubUrl":"https://github.com/MemPalace/mempalace/blob/06cb6987f02610784fefbad4b2bd5d026d164ba6/mempalace/backends/pgvector.py#L979-L1015","documentation":"Error \"update requires at least one of documents, metadatas, embeddings\" thrown in MemPalace/mempalace.","triggerScenarios":"Thrown at mempalace/backends/pgvector.py:997 when the library encounters an invalid state.","commonSituations":"Update invoked with nothing to change.","solutions":["Pass at least one of documents, metadatas, or embeddings to update"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"06cb6987f02610784fefbad4b2bd5d026d164ba6","analyzedAt":"2026-08-15T03:03:36.213Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}