{"record":{"id":"1db91d9dd8e28aec","repo":"MemPalace/mempalace","slug":"label-length-len-value-does-not-match-ids-len-1db91d","errorCode":null,"errorMessage":"{label} length {len(value)} does not match ids length {n}","messagePattern":"(.+?) length (.+?) does not match ids length (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"mempalace/backends/milvus.py","lineNumber":576,"sourceCode":"            embeddings=embeddings,\n        )\n        if not rows:\n            return\n        self._ensure_remote_collection(dimension)\n        self._client.upsert(collection_name=self._remote_collection, data=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=list(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 = []\n        out_docs = []\n        out_metas = []\n        out_embeddings = []\n        for idx, doc_id in enumerate(ids):\n            if doc_id not in by_id:\n                continue\n            prev_doc, prev_meta, prev_embedding = by_id[doc_id]\n            out_ids.append(doc_id)\n            out_docs.append(documents[idx] if documents is not None else prev_doc)\n            meta = dict(prev_meta or {})\n            if metadatas is not None:","sourceCodeStart":558,"sourceCodeEnd":594,"githubUrl":"https://github.com/MemPalace/mempalace/blob/06cb6987f02610784fefbad4b2bd5d026d164ba6/mempalace/backends/milvus.py#L558-L594","documentation":"Error \"{label} length {len(value)} does not match ids length {n}\" thrown in MemPalace/mempalace.","triggerScenarios":"Thrown at mempalace/backends/milvus.py:576 when the library encounters an invalid state.","commonSituations":"Per-id field list length drifted from the ids list length.","solutions":["Align the length of the supplied list with the ids list before calling 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-15T22:17:37.221Z"}