mirror of
https://github.com/hwchase17/langchain.git
synced 2025-05-25 00:47:39 +00:00
community[patch]: Better error message for neo4j vector when text is null (#21861)
This commit is contained in:
parent
f2e75f9500
commit
d85e46321a
@ -1043,6 +1043,19 @@ class Neo4jVector(VectorStore):
|
||||
|
||||
results = self.query(read_query, params=parameters)
|
||||
|
||||
if any(result["text"] is None for result in results):
|
||||
if not self.retrieval_query:
|
||||
raise ValueError(
|
||||
f"Make sure that none of the `{self.text_node_property}` "
|
||||
f"properties on nodes with label `{self.node_label}` "
|
||||
"are missing or empty"
|
||||
)
|
||||
else:
|
||||
raise ValueError(
|
||||
"Inspect the `retrieval_query` and ensure it doesn't "
|
||||
"return None for the `text` column"
|
||||
)
|
||||
|
||||
docs = [
|
||||
(
|
||||
Document(
|
||||
|
Loading…
Reference in New Issue
Block a user