From ac7b71e0d7a774d821c5aeda3736498458796c45 Mon Sep 17 00:00:00 2001 From: Nada Amin Date: Thu, 22 Aug 2024 16:29:52 -0400 Subject: [PATCH] langchain_community.graphs: Neo4JGraph: prop min_size might be None (#23944) When I used the Neo4JGraph enhanced_schema=True option, I ran into an error because a prop min_size of None was compared numerically with an int. The fix I applied is similar to the pattern of skipping embeddings elsewhere in the file. Co-authored-by: ccurme --- libs/community/langchain_community/graphs/neo4j_graph.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/community/langchain_community/graphs/neo4j_graph.py b/libs/community/langchain_community/graphs/neo4j_graph.py index 55c03005d9a..f19ff07330c 100644 --- a/libs/community/langchain_community/graphs/neo4j_graph.py +++ b/libs/community/langchain_community/graphs/neo4j_graph.py @@ -246,7 +246,7 @@ def _format_schema(schema: Dict, is_enhanced: bool) -> str: ) elif prop["type"] == "LIST": # Skip embeddings - if prop["min_size"] > LIST_LIMIT: + if not prop.get("min_size") or prop["min_size"] > LIST_LIMIT: continue example = ( f'Min Size: {prop["min_size"]}, Max Size: {prop["max_size"]}'