chroma-core/chroma · error · TypeError
{op} requires a dict, got {type(agg_data).__name__}
Error message
{op} requires a dict, got {type(agg_data).__name__} What it means
Error "{op} requires a dict, got {type(agg_data).__name__}" thrown in chroma-core/chroma.
Source
Thrown at chromadb/execution/expression/operator.py:1357
def _parse_k_aggregate(
op: str, data: Dict[str, Any]
) -> tuple[List[Union[Key, str]], int]:
"""Parse common fields for MinK/MaxK from dict.
Args:
op: The operator name (e.g., "$min_k" or "$max_k")
data: The dict containing the operator
Returns:
Tuple of (keys, k) where keys is List[Union[Key, str]] and k is int
Raises:
TypeError: If data types are invalid
ValueError: If required fields are missing or invalid
"""
agg_data = data[op]
if not isinstance(agg_data, dict):
raise TypeError(f"{op} requires a dict, got {type(agg_data).__name__}")
if "keys" not in agg_data:
raise ValueError(f"{op} requires 'keys' field")
if "k" not in agg_data:
raise ValueError(f"{op} requires 'k' field")
keys = agg_data["keys"]
if not isinstance(keys, (list, tuple)):
raise TypeError(f"{op} keys must be a list, got {type(keys).__name__}")
if not keys:
raise ValueError(f"{op} keys cannot be empty")
k = agg_data["k"]
if not isinstance(k, int):
raise TypeError(f"{op} k must be an integer, got {type(k).__name__}")
if k <= 0:
raise ValueError(f"{op} k must be positive, got {k}")
return _strings_to_keys(keys), kView on GitHub (pinned to aecdd12c8a)
When it happens
Trigger: Thrown at chromadb/execution/expression/operator.py:1357 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of chroma-core/chroma@aecdd12c8a (2026-08-16).
Data as JSON: /api/errors/e0253b2bdf7c62a6.
Report an issue: GitHub.