{"record":{"id":"b283ea2c5dc1e7a0","repo":"chroma-core/chroma","slug":"unknown-aggregate-operator-op","errorCode":null,"errorMessage":"Unknown aggregate operator: {op}","messagePattern":"Unknown aggregate operator: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"chromadb/execution/expression/operator.py","lineNumber":1429,"sourceCode":"\n        if not data:\n            raise ValueError(\"Aggregate dict cannot be empty\")\n\n        if len(data) != 1:\n            raise ValueError(\n                f\"Aggregate dict must contain exactly one operator, got {len(data)}\"\n            )\n\n        op = next(iter(data.keys()))\n\n        if op == \"$min_k\":\n            keys, k = _parse_k_aggregate(op, data)\n            return MinK(keys=keys, k=k)\n        elif op == \"$max_k\":\n            keys, k = _parse_k_aggregate(op, data)\n            return MaxK(keys=keys, k=k)\n        else:\n            raise ValueError(f\"Unknown aggregate operator: {op}\")\n\n\n@dataclass\nclass MinK(Aggregate):\n    \"\"\"Keep k records with minimum aggregate key values per group\"\"\"\n\n    keys: OneOrMany[Union[Key, str]]\n    k: int\n\n    def to_dict(self) -> Dict[str, Any]:\n        return {\"$min_k\": {\"keys\": _keys_to_strings(self.keys), \"k\": self.k}}\n\n\n@dataclass\nclass MaxK(Aggregate):\n    \"\"\"Keep k records with maximum aggregate key values per group\"\"\"\n\n    keys: OneOrMany[Union[Key, str]]","sourceCodeStart":1411,"sourceCodeEnd":1447,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/chromadb/execution/expression/operator.py#L1411-L1447","documentation":"Raised by Aggregate.from_dict when the single operator key in the dict is neither '$min_k' nor '$max_k' — e.g. a typo like '$topk' or an unsupported aggregation name was used.","triggerScenarios":"Thrown at chromadb/execution/expression/operator.py:1429 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use one of the supported operators: $min_k or $max_k","Check for typos like $mink, $min_k_, or $top_k","Verify client and server versions agree on the aggregate expression schema"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"aecdd12c8a891610db8653630b066b32ceb678b5","analyzedAt":"2026-08-16T21:53:27.228Z","contentChangedAt":"2026-08-16T21:53:27.228Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}