Skip to content

The agent engineering platform.

Fix neo4j type error on missing constraint information (#24177)

Tomaz Bratanicd3a2b9fae070
diff --git a/libs/community/langchain_community/graphs/neo4j_graph.py b/libs/community/langchain_community/graphs/neo4j_graph.py
index 4897348a7b..55c03005d9 100644
--- a/libs/community/langchain_community/graphs/neo4j_graph.py
+++ b/libs/community/langchain_community/graphs/neo4j_graph.py
@@ -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(