Better error messages

pull/21861/head
Tomaz Bratanic 4 weeks ago
parent 28c958a361
commit 2f9df5a6d2

@ -1044,12 +1044,17 @@ class Neo4jVector(VectorStore):
results = self.query(read_query, params=parameters)
if any(result["text"] is None for result in results):
raise ValueError(
"If you are using `text_node_property`, make sure it is not null "
"for any of the indexed nodes. If using `from_existing_graph` or "
"`retrieval_query`, ensure it doesn't return None for "
"the `text` column."
)
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 = [
(

Loading…
Cancel
Save