{"record":{"id":"9a79f16cce544277","repo":"chroma-core/chroma","slug":"op-keys-must-be-a-list-got-type-keys-name","errorCode":null,"errorMessage":"{op} keys must be a list, got {type(keys).__name__}","messagePattern":"(.+?) keys must be a list, got (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"chromadb/execution/expression/operator.py","lineNumber":1365,"sourceCode":"\n    Returns:\n        Tuple of (keys, k) where keys is List[Union[Key, str]] and k is int\n\n    Raises:\n        TypeError: If data types are invalid\n        ValueError: If required fields are missing or invalid\n    \"\"\"\n    agg_data = data[op]\n    if not isinstance(agg_data, dict):\n        raise TypeError(f\"{op} requires a dict, got {type(agg_data).__name__}\")\n    if \"keys\" not in agg_data:\n        raise ValueError(f\"{op} requires 'keys' field\")\n    if \"k\" not in agg_data:\n        raise ValueError(f\"{op} requires 'k' field\")\n\n    keys = agg_data[\"keys\"]\n    if not isinstance(keys, (list, tuple)):\n        raise TypeError(f\"{op} keys must be a list, got {type(keys).__name__}\")\n    if not keys:\n        raise ValueError(f\"{op} keys cannot be empty\")\n\n    k = agg_data[\"k\"]\n    if not isinstance(k, int):\n        raise TypeError(f\"{op} k must be an integer, got {type(k).__name__}\")\n    if k <= 0:\n        raise ValueError(f\"{op} k must be positive, got {k}\")\n\n    return _strings_to_keys(keys), k\n\n\n@dataclass\nclass Aggregate:\n    \"\"\"Base class for aggregation expressions within groups.\n\n    Aggregations determine which records to keep from each group:\n    - MinK: Keep k records with minimum values (ascending order)","sourceCodeStart":1347,"sourceCodeEnd":1383,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/chromadb/execution/expression/operator.py#L1347-L1383","documentation":"Error \"{op} keys must be a list, got {type(keys).__name__}\" thrown in chroma-core/chroma.","triggerScenarios":"Thrown at chromadb/execution/expression/operator.py:1365 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"}