{"record":{"id":"7bb54ac9be71724d","repo":"microsoft/semantic-kernel","slug":"unsupported-boolop-type-op","errorCode":null,"errorMessage":"Unsupported BoolOp: {type(op)}","messagePattern":"Unsupported BoolOp: (.+?)","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"warning","filePath":"python/semantic_kernel/connectors/chroma.py","lineNumber":407,"sourceCode":"                    case ast.NotEq():\n                        return {left: {\"$ne\": right}}  # type: ignore\n                    case ast.Gt():\n                        return {left: {\"$gt\": right}}  # type: ignore\n                    case ast.GtE():\n                        return {left: {\"$gte\": right}}  # type: ignore\n                    case ast.Lt():\n                        return {left: {\"$lt\": right}}  # type: ignore\n                    case ast.LtE():\n                        return {left: {\"$lte\": right}}  # type: ignore\n                raise NotImplementedError(f\"Unsupported operator: {type(op)}\")\n            case ast.BoolOp():\n                op = node.op  # type: ignore\n                values = [self._lambda_parser(v) for v in node.values]\n                if isinstance(op, ast.And):\n                    return {\"$and\": values}\n                if isinstance(op, ast.Or):\n                    return {\"$or\": values}\n                raise NotImplementedError(f\"Unsupported BoolOp: {type(op)}\")\n            case ast.UnaryOp():\n                raise NotImplementedError(\"Unary +, -, ~ and ! are not supported in Chroma filters.\")\n            case ast.Attribute():\n                # Only allow attributes that are in the data model\n                if node.attr not in self.definition.storage_names:\n                    raise VectorStoreOperationException(\n                        f\"Field '{node.attr}' not in data model (storage property names are used).\"\n                    )\n                return node.attr\n            case ast.Name():\n                # Only allow names that are in the data model\n                if node.id not in self.definition.storage_names:\n                    raise VectorStoreOperationException(\n                        f\"Field '{node.id}' not in data model (storage property names are used).\"\n                    )\n                return node.id\n            case ast.Constant():\n                value = node.value","sourceCodeStart":389,"sourceCodeEnd":425,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/python/semantic_kernel/connectors/chroma.py#L389-L425","documentation":"A NotImplementedError raised by _lambda_parser when a BoolOp uses an operator other than ast.And or ast.Or. Python's ast only defines And and Or for BoolOp, so in practice this branch is effectively unreachable from pure-Python lambda source — but the guard exists for completeness and would fire if the AST were constructed synthetically or by a future grammar change.","triggerScenarios":"Effectively unreachable from standard Python lambda parsing (Python BoolOp.op is always And or Or). Could fire only if a custom/manually-built AST node is fed to _lambda_parser.","commonSituations":"Not encountered in normal use; present as a defensive guard. No user action expected beyond updating the library if Python grammar ever adds a boolean operator.","solutions":["No action required for normal lambda filters — this guard is defensive.","If encountered via custom AST, replace the BoolOp.op with ast.And or ast.Or."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"import ast\n\ndef filter_uses_standard_boolops(src: str) -> bool:\n    tree = ast.parse(src, mode=\"eval\")\n    return all(isinstance(n.op, (ast.And, ast.Or))\n               for n in ast.walk(tree) if isinstance(n, ast.BoolOp))","tryCatchPattern":"try:\n    results = await collection.vectorized_search(vector=v, options=opts)\nexcept NotImplementedError as e:\n    if \"Unsupported BoolOp\" in str(e):\n        # report library bug; standard Python cannot reach this branch\n        ...","preventionTips":["No routine action — this branch is defensive and unreachable from normal Python lambdas.","Report to the library if it triggers."],"tags":["chroma","vector-store","filter","lambda","not-implemented","defensive"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}