{"record":{"id":"c9ba81a55ecb0b0a","repo":"microsoft/semantic-kernel","slug":"field-node-id-not-in-data-model-storage-prope","errorCode":null,"errorMessage":"Field '{node.id}' 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":420,"sourceCode":"                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\n                raise VectorStoreOperationException(f\"Unsupported constant type: {type(value)}\")\n        raise NotImplementedError(f\"Unsupported AST node: {type(node)}\")\n\n\n@release_candidate\nclass ChromaStore(VectorStore):\n    \"\"\"Chroma vector store.\"\"\"","sourceCodeStart":402,"sourceCodeEnd":438,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/python/semantic_kernel/connectors/chroma.py#L402-L438","documentation":"A VectorStoreOperationException raised by _lambda_parser when an ast.Name node's id is not in self.definition.storage_names. Unlike attribute access (x.field), a bare Name (e.g. a variable referenced without a qualifier) is only permitted if it resolves to a known storage property name. This catches filters that reference undefined variables or unqualified property names.","triggerScenarios":"Writing a filter lambda that references a bare name instead of an attribute — e.g. 'lambda x: tag == \"foo\"' (tag is a Name, not x.tag) — where 'tag' is not a declared storage property; or referencing a captured variable that collides with an intended field name.","commonSituations":"Forgetting the 'x.' qualifier in a lambda; using a free variable that happens not to be a model field; copy-paste errors leaving a field name unqualified.","solutions":["Qualify the field with the lambda parameter: use 'x.tag' instead of 'tag'.","Ensure the referenced name matches a declared storage property name in the definition."],"exampleFix":"// before\nlambda x: tag == \"foo\"   # bare Name 'tag' not in storage_names\n// after\nlambda x: x.tag == \"foo\"  # qualified attribute access","handlingStrategy":"validation","validationCode":"valid = set(definition.storage_names)\ntree = ast.parse(filter_lambda_src, mode=\"eval\")\nfree_names = {n.id for n in ast.walk(tree) if isinstance(n, ast.Name) and n.id != <lambda_param>}\nassert free_names <= valid, f\"Filter references unknown names: {free_names - valid}\"","typeGuard":"def name_in_storage_names(definition, name: str) -> bool:\n    return name 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        # qualify the bare name with the lambda parameter (x.<name>)\n        ...","preventionTips":["Always qualify field access with the lambda parameter (x.field, not field).","Avoid shadowing field names with external variables captured in the lambda."],"tags":["chroma","vector-store","filter","lambda","data-model"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}