{"record":{"id":"ad21847696e9e0d5","repo":"RyanCodrai/turbovec","slug":"filter-operator-op-r-not-supported-by-turboquant","errorCode":null,"errorMessage":"filter operator {op!r} not supported by TurboQuantVectorStore","messagePattern":"filter operator (.+?) not supported by TurboQuantVectorStore","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"turbovec-python/python/turbovec/llama_index.py","lineNumber":782,"sourceCode":"            raise TypeError(\n                \"Both metadata value and filter value must be strings \"\n                \"for the TEXT_MATCH operator\"\n            )\n        if _TEXT_MATCH_INSENSITIVE is not None and op == _TEXT_MATCH_INSENSITIVE:\n            if isinstance(target, str) and isinstance(value, str):\n                return target.lower() in value.lower()\n            raise TypeError(\n                \"Both metadata value and filter value must be strings \"\n                \"for the TEXT_MATCH_INSENSITIVE operator\"\n            )\n        if op == FilterOperator.ALL:\n            # Reference (`utils.py:152-153`): every element of `target`\n            # must be present in the metadata value (which is typically\n            # a list — tag-set matching).\n            return all(t in value for t in target)\n        if op == FilterOperator.ANY:\n            return any(t in value for t in target)\n        raise NotImplementedError(\n            f\"filter operator {op!r} not supported by TurboQuantVectorStore\"\n        )\n\n    def query(self, query: VectorStoreQuery, **_: Any) -> VectorStoreQueryResult:\n        # MMR / SVM / LINEAR_REGRESSION / HYBRID etc. all need access to\n        # full-precision vectors (for pairwise diversity, learned scoring,\n        # or sparse-dense fusion). turbovec discards full precision after\n        # quantization, so any non-DEFAULT mode is unsupportable here.\n        # Raise loudly instead of silently treating it as DEFAULT, which\n        # the previous impl did and which let callers think they were\n        # getting e.g. MMR diversity when they were not.\n        if query.mode != VectorStoreQueryMode.DEFAULT:\n            raise NotImplementedError(\n                f\"TurboQuantVectorStore does not support query mode \"\n                f\"{query.mode!r}. Only VectorStoreQueryMode.DEFAULT is \"\n                \"supported — MMR / SVM / hybrid modes need access to \"\n                \"full-precision vectors which turbovec discards after \"\n                \"quantization. Maintain a parallel store with full vectors \"","sourceCodeStart":764,"sourceCodeEnd":800,"githubUrl":"https://github.com/RyanCodrai/turbovec/blob/ccab9f325e6ce2a270a87daf01ae4e443bcf2d49/turbovec-python/python/turbovec/llama_index.py#L764-L800","documentation":"NotImplementedError raised in _single_filter_match when the filter operator is one TurboQuantVectorStore does not implement — any FilterOperator beyond the supported set (CONTAINS, TEXT_MATCH, TEXT_MATCH_INSENSITIVE, ALL, ANY, and the comparison/equality operators handled earlier). It fails loudly rather than silently mis-evaluating an unsupported operator.","triggerScenarios":"Passing a MetadataFilter with an operator outside the supported set (e.g. FilterOperator.CONTAINS or IS_EMPTY depending on version) via query/delete_nodes/get_nodes filters.","commonSituations":"Version drift between llama_index-core releases adding/removing operators; copy-pasted filter code using an operator this store never implemented.","solutions":["Rewrite the filter using a supported operator (e.g. EQ, IN, TEXT_MATCH)","Emulate unsupported operators with custom filtering after fetching nodes","Check the installed llama_index-core's FilterOperator enum and this store's docs"],"exampleFix":"// before\nMetadataFilter(key=\"tags\", value=\"a\", operator=FilterOperator.CONTAINS)\n// after\nMetadataFilter(key=\"tags\", value=\"a\", operator=FilterOperator.IN)","handlingStrategy":"fallback","validationCode":"SUPPORTED = {FilterOperator.EQ, FilterOperator.NE, FilterOperator.GT, FilterOperator.GTE, FilterOperator.LT, FilterOperator.LTE, FilterOperator.IN, FilterOperator.ANY, FilterOperator.ALL, FilterOperator.TEXT_MATCH, FilterOperator.TEXT_MATCH_INSENSITIVE}\nassert all(f.operator in SUPPORTED for f in filters.filters), \"unsupported filter operator\"","typeGuard":null,"tryCatchPattern":"try:\n    store.query(q)\nexcept NotImplementedError as e:\n    if \"filter operator\" in str(e):\n        raise RuntimeError(\"rewrite this filter with a supported operator\") from e\n    raise","preventionTips":["Centralize filter building through a wrapper that only emits supported operators","Pin and test against the llama_index-core version in use","Review FilterOperator enum changes on library upgrades"],"tags":["python","filters","llama-index","not-implemented"],"backgroundTag":"unsupported-enum-value","analyzedSha":"ccab9f325e6ce2a270a87daf01ae4e443bcf2d49","analyzedAt":"2026-09-06T08:39:18.516Z","contentChangedAt":"2026-09-06T08:39:18.516Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}