{"record":{"id":"8d4de425448c3aef","repo":"chroma-core/chroma","slug":"not-a-valid-spann-config-e","errorCode":null,"errorMessage":"not a valid spann config: {e}","messagePattern":"not a valid spann config: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"info","filePath":"chromadb/api/collection_configuration.py","lineNumber":151,"sourceCode":"            spann_config = config.get_parameter(\"spann\").value\n        except ValueError:\n            spann_config = None\n        try:\n            ef = config.get_parameter(\"embedding_function\").value\n        except ValueError:\n            ef = None\n\n    ef_config: Dict[str, Any] | None = None\n    if hnsw_config is not None:\n        try:\n            hnsw_config = cast(HNSWConfiguration, hnsw_config)\n        except Exception as e:\n            raise ValueError(f\"not a valid hnsw config: {e}\")\n    if spann_config is not None:\n        try:\n            spann_config = cast(SpannConfiguration, spann_config)\n        except Exception as e:\n            raise ValueError(f\"not a valid spann config: {e}\")\n\n    if ef is None:\n        ef = None\n        ef_config = {\"type\": \"legacy\"}\n\n    if ef is not None:\n        try:\n            if ef.is_legacy():\n                ef_config = {\"type\": \"legacy\"}\n            else:\n                ef_config = {\n                    \"name\": ef.name(),\n                    \"type\": \"known\",\n                    \"config\": ef.get_config(),\n                }\n                register_embedding_function(type(ef))  # type: ignore\n        except Exception as e:\n            warnings.warn(","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/chromadb/api/collection_configuration.py#L133-L169","documentation":"Companion dead branch in collection_configuration_to_json(): the 'spann' value is passed through typing.cast(SpannConfiguration, ...) with an except that would raise this ValueError. Since typing.cast performs no runtime validation, the exception can never fire; the branch exists only as (ineffective) intent to reject invalid SPANN configuration dicts.","triggerScenarios":"None at runtime — the cast never raises, so this error is unreachable as written.","commonSituations":"Found only via source search or code review; no user-visible behavior is attached to it.","solutions":["No action needed — unreachable code.","For genuine SPANN validation, check the dict keys against SpannConfiguration fields before passing the configuration in."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"SPANN_KEYS = {\"search_nprobe\", \"write_nprobe\", \"space\", \"ef_construction\", \"ef_search\", \"max_neighbors\", \"reassign_neighbor_count\", \"split_threshold\", \"merge_threshold\"}\n\ndef valid_spann_dict(cfg: dict) -> bool:\n    return isinstance(cfg, dict) and set(cfg) <= SPANN_KEYS","typeGuard":null,"tryCatchPattern":null,"preventionTips":["No guard needed: the raise site is unreachable (typing.cast never throws).","Validate spann configuration keys yourself if you need real enforcement."],"tags":["chroma","collection-configuration","spann","dead-code","vector-index"],"backgroundTag":"config-validation-failed","analyzedSha":"aecdd12c8a891610db8653630b066b32ceb678b5","analyzedAt":"2026-08-16T21:53:27.228Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}