mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-10 13:27:36 +00:00
Fix neo4j type error on missing constraint information (#24177)
If you use `refresh_schema=False`, then the metadata constraint doesn't exist. ATM, we used default `None` in the constraint check, but then `any` fails because it can't iterate over None value
This commit is contained in:
parent
7014d07cab
commit
d3a2b9fae0
@ -555,10 +555,11 @@ class Neo4jGraph(GraphStore):
|
||||
el["labelsOrTypes"] == [BASE_ENTITY_LABEL]
|
||||
and el["properties"] == ["id"]
|
||||
for el in self.structured_schema.get("metadata", {}).get(
|
||||
"constraint"
|
||||
"constraint", []
|
||||
)
|
||||
]
|
||||
)
|
||||
|
||||
if not constraint_exists:
|
||||
# Create constraint
|
||||
self.query(
|
||||
|
Loading…
Reference in New Issue
Block a user