From 3e45b8306555a48b5838ed7dd33b1a4c615bdd18 Mon Sep 17 00:00:00 2001 From: Hao Chen Date: Sun, 4 Jun 2023 07:56:39 +0800 Subject: [PATCH] Improve Error Messaging for APOC Procedure Failure in Neo4jGraph (#5547) ## Improve Error Messaging for APOC Procedure Failure in Neo4jGraph This commit revises the error message provided when the 'apoc.meta.data()' procedure fails. Previously, the message simply instructed the user to install the APOC plugin in Neo4j. The new error message is more specific. Also removed an unnecessary newline in the Cypher statement variable: `node_properties_query`. Fixes #5545 ## Who can review? - @vowelparrot - @dev2049 --- langchain/graphs/neo4j_graph.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/langchain/graphs/neo4j_graph.py b/langchain/graphs/neo4j_graph.py index 4433771a..8942b2b2 100644 --- a/langchain/graphs/neo4j_graph.py +++ b/langchain/graphs/neo4j_graph.py @@ -62,7 +62,8 @@ class Neo4jGraph: except neo4j.exceptions.ClientError: raise ValueError( "Could not use APOC procedures. " - "Please install the APOC plugin in Neo4j." + "Please ensure the APOC plugin is installed in Neo4j and that " + "'apoc.meta.data()' is allowed in Neo4j configuration " ) @property