{"record":{"id":"7d6165d7247d14ce","repo":"chroma-core/chroma","slug":"sparsevector-indices-and-values-must-have-the-same","errorCode":null,"errorMessage":"SparseVector indices and values must have the same length, got {len(self.indices)} indices and {len(self.values)} values","messagePattern":"SparseVector indices and values must have the same length, got (.+?) indices and (.+?) values","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"chromadb/base_types.py","lineNumber":45,"sourceCode":"\n    indices: List[int]\n    values: List[float]\n    labels: Optional[List[str]] = None\n\n    def __post_init__(self) -> None:\n        \"\"\"Validate sparse vector structure.\"\"\"\n        if not isinstance(self.indices, list):\n            raise ValueError(\n                f\"Expected SparseVector indices to be a list, got {type(self.indices).__name__}\"\n            )\n\n        if not isinstance(self.values, list):\n            raise ValueError(\n                f\"Expected SparseVector values to be a list, got {type(self.values).__name__}\"\n            )\n\n        if len(self.indices) != len(self.values):\n            raise ValueError(\n                f\"SparseVector indices and values must have the same length, \"\n                f\"got {len(self.indices)} indices and {len(self.values)} values\"\n            )\n\n        if self.labels is not None:\n            if not isinstance(self.labels, list):\n                raise ValueError(\n                    f\"Expected SparseVector labels to be a list, got {type(self.labels).__name__}\"\n                )\n            if len(self.labels) != len(self.indices):\n                raise ValueError(\n                    f\"SparseVector labels must have the same length as indices and values, \"\n                    f\"got {len(self.labels)} labels, {len(self.indices)} indices\"\n                )\n\n        for i, idx in enumerate(self.indices):\n            if not isinstance(idx, int):\n                raise ValueError(","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/chromadb/base_types.py#L27-L63","documentation":"Error \"SparseVector indices and values must have the same length, got {len(self.indices)} indices and {len(self.values)} values\" thrown in chroma-core/chroma.","triggerScenarios":"Thrown at chromadb/base_types.py:45 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"aecdd12c8a891610db8653630b066b32ceb678b5","analyzedAt":"2026-08-16T21:53:27.228Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}