{"record":{"id":"877904d52e86e01e","repo":"microsoft/semantic-kernel","slug":"field-node-attr-not-in-data-model-storage-pro-877904","errorCode":null,"errorMessage":"Field '{node.attr}' not in data model (storage property names are used).","messagePattern":"Field '(.+?)' not in data model \\(storage property names are used\\)\\.","errorType":"exception","errorClass":"VectorStoreOperationException","httpStatus":null,"severity":"error","filePath":"python/semantic_kernel/connectors/chroma.py","lineNumber":413,"sourceCode":"                    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\n                if isinstance(value, str):\n                    return value.replace(\"'\", \"''\")\n                if isinstance(value, bytes):\n                    return value.decode(\"utf-8\").replace(\"'\", \"''\")\n                if isinstance(value, (int, float, bool)) or value is None:\n                    return value","sourceCodeStart":395,"sourceCodeEnd":431,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/python/semantic_kernel/connectors/chroma.py#L395-L431","documentation":"A VectorStoreOperationException raised by _lambda_parser when an ast.Attribute node references an attribute name not present in self.definition.storage_names. The filter translator only allows attribute access (e.g. x.field) on properties that exist in the data model using their storage (column) names, preventing arbitrary attribute traversal and injection.","triggerScenarios":"Writing a filter lambda that accesses a property not declared in the record model, or using the Python property name when the storage name differs (e.g. accessing x.title when the field is stored as 'name', or referencing a computed/non-stored attribute).","commonSituations":"Renaming a storage property without updating filter lambdas; filtering on a field that was dropped from the model; using the public attribute name while the definition maps it to a different storage_name.","solutions":["Reference only storage property names declared in the VectorStoreCollectionDefinition (check definition.storage_names).","If the field was renamed, update the lambda to use the current storage name, or add the field back to the model."],"exampleFix":"// before\nlambda x: x.title == \"foo\"   # 'title' not in storage_names\n// after\nlambda x: x.name == \"foo\"    # use the declared storage name","handlingStrategy":"validation","validationCode":"valid = set(definition.storage_names)\ntree = ast.parse(filter_lambda_src, mode=\"eval\")\nattrs = {n.attr for n in ast.walk(tree) if isinstance(n, ast.Attribute)}\nassert attrs <= valid, f\"Filter references unknown fields: {attrs - valid}\"","typeGuard":"def attribute_in_storage_names(definition, attr: str) -> bool:\n    return attr in set(definition.storage_names)","tryCatchPattern":"from semantic_kernel.exceptions.vector_store_exceptions import VectorStoreOperationException\ntry:\n    results = await collection.vectorized_search(vector=v, options=opts)\nexcept VectorStoreOperationException as e:\n    if \"not in data model\" in str(e):\n        # correct the attribute name to a declared storage name\n        ...","preventionTips":["Reference only declared storage property names in filter lambdas.","Keep filter lambdas in sync with the model when storage names change."],"tags":["chroma","vector-store","filter","lambda","data-model"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}