{"record":{"id":"1af7a9a610a02a8c","repo":"RyanCodrai/turbovec","slug":"filter-condition-condition-r-not-supported-by-tu","errorCode":null,"errorMessage":"filter condition {condition!r} not supported by TurboQuantVectorStore","messagePattern":"filter condition (.+?) not supported by TurboQuantVectorStore","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"turbovec-python/python/turbovec/llama_index.py","lineNumber":712,"sourceCode":"            if isinstance(f, MetadataFilters):\n                # Deliberate superset of the reference: SimpleVectorStore's\n                # build_metadata_filter_fn raises ValueError on nested\n                # MetadataFilters groups; turbovec recurses and evaluates\n                # them. Per-operator semantics still match the reference\n                # (see _single_filter_match).\n                results.append(cls._filters_match(metadata, f))\n            else:\n                results.append(cls._single_filter_match(metadata, f))\n        if condition == FilterCondition.AND:\n            return all(results) if results else True\n        if condition == FilterCondition.OR:\n            return any(results) if results else True\n        if _CONDITION_NOT is not None and condition == _CONDITION_NOT:\n            # Reference semantics (`build_metadata_filter_fn`,\n            # `utils.py:187-189`): NOT matches when none of the inner\n            # filters match. Empty inner list trivially satisfies NOT.\n            return not any(results)\n        raise NotImplementedError(\n            f\"filter condition {condition!r} not supported by TurboQuantVectorStore\"\n        )\n\n    @staticmethod\n    def _single_filter_match(metadata: dict[str, Any], f: MetadataFilter) -> bool:\n        # Semantics mirror SimpleVectorStore's _build_metadata_filter_fn\n        # (llama_index/core/vector_stores/simple.py) so that filtered\n        # results agree with the in-tree reference store.\n        op = f.operator\n        target = f.value\n        value = metadata.get(f.key)\n\n        # IS_EMPTY is the only operator that treats a missing key as a hit.\n        if op == FilterOperator.IS_EMPTY:\n            return value is None or value == \"\" or value == []\n\n        # Missing key: no value to compare, so every operator declines —\n        # EXCEPT the negative ones. \"this node's colour is not red\" is","sourceCodeStart":694,"sourceCodeEnd":730,"githubUrl":"https://github.com/RyanCodrai/turbovec/blob/ccab9f325e6ce2a270a87daf01ae4e443bcf2d49/turbovec-python/python/turbovec/llama_index.py#L694-L730","documentation":"_filters_match only implements AND, OR, and NOT condition types from LlamaIndex's MetadataFilters. Any other FilterCondition (e.g. custom or newly added enum values) hits the fallthrough NotImplementedError.","triggerScenarios":"Passing VectorStoreQuery(filters=MetadataFilters(condition=<unsupported>)) to delete_nodes, get_nodes, or query where condition is not AND/OR/NOT.","commonSituations":"Upgrading llama_index-core introduces a new FilterCondition and code passes it through; copy-pasted filter code using an exotic condition.","solutions":["Rewrite the filter using MetadataFilters(condition=FilterCondition.AND/OR/NOT)","Simplify to a single flat filter list (implicit AND)","Check supported conditions before building filters"],"exampleFix":"// before\nfilters = MetadataFilters(filters=[...], condition=FilterCondition.PIPE)\n// after\nfilters = MetadataFilters(filters=[...], condition=FilterCondition.AND)","handlingStrategy":"validation","validationCode":"from llama_index.core.vector_stores.types import FilterCondition\nassert filters.condition in (FilterCondition.AND, FilterCondition.OR, FilterCondition.NOT)","typeGuard":null,"tryCatchPattern":"try:\n    results = store.query(q)\nexcept NotImplementedError as e:\n    if \"filter condition\" in str(e):\n        q.filters = MetadataFilters(filters=q.filters.filters, condition=FilterCondition.AND)\n        results = store.query(q)\n    else:\n        raise","preventionTips":["Restrict filter construction helpers to AND/OR/NOT","Pin llama_index-core versions and test filters against upgrades","Keep flat filter lists where possible"],"tags":["python","llama-index","filters","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"}