{"record":{"id":"5f573822e74d6e9e","repo":"chroma-core/chroma","slug":"select-key-must-be-a-string-got-type-k-name","errorCode":null,"errorMessage":"Select key must be a string, got {type(k).__name__}","messagePattern":"Select key must be a string, got (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"chromadb/execution/expression/operator.py","lineNumber":1298,"sourceCode":"\n        Examples:\n        - {\"keys\": [\"#document\", \"#score\"]} -> Select(keys={Key.DOCUMENT, Key.SCORE})\n        - {\"keys\": [\"title\", \"author\"]} -> Select(keys={\"title\", \"author\"})\n        \"\"\"\n        if not isinstance(data, dict):\n            raise TypeError(f\"Expected dict for Select, got {type(data).__name__}\")\n\n        keys = data.get(\"keys\", [])\n        if not isinstance(keys, (list, tuple, set)):\n            raise TypeError(\n                f\"Select keys must be a list/tuple/set, got {type(keys).__name__}\"\n            )\n\n        # Validate and convert each key\n        key_list = []\n        for k in keys:\n            if not isinstance(k, str):\n                raise TypeError(f\"Select key must be a string, got {type(k).__name__}\")\n\n            # Map special keys to Key instances\n            if k == \"#id\":\n                key_list.append(Key.ID)\n            elif k == \"#document\":\n                key_list.append(Key.DOCUMENT)\n            elif k == \"#embedding\":\n                key_list.append(Key.EMBEDDING)\n            elif k == \"#metadata\":\n                key_list.append(Key.METADATA)\n            elif k == \"#score\":\n                key_list.append(Key.SCORE)\n            else:\n                # Regular metadata field\n                key_list.append(Key(k))\n\n        # Check for unexpected keys in dict\n        allowed_keys = {\"keys\"}","sourceCodeStart":1280,"sourceCodeEnd":1316,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/chromadb/execution/expression/operator.py#L1280-L1316","documentation":"Error \"Select key must be a string, got {type(k).__name__}\" thrown in chroma-core/chroma.","triggerScenarios":"Thrown at chromadb/execution/expression/operator.py:1298 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"}