Skip to content

Commit bbbc582

Browse files
committed
fix: repair neo4j neighbor expansion query
1 parent ffcd1da commit bbbc582

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

aperag/indexing/graph_storage/neo4j.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@ async def _fetch_relations_touching(session, names: list[str]) -> set[str]:
756756
return set()
757757
relation_query = (
758758
f"MATCH (r:{_RELATION_LABEL} {{collection_id: $collection_id}}) "
759-
f"WHERE {{endpoint_predicate}} "
759+
"WHERE {endpoint_predicate} "
760760
f"RETURN r.source AS source, r.target AS target, r.relation_type AS relation_type, "
761761
f" r.evidence_lineage AS evidence_lineage, "
762762
f" r.description_parts AS description_parts, "
@@ -788,13 +788,13 @@ async def _consume(result) -> None:
788788
# matching composite index instead of evaluating an OR over
789789
# the full per-collection relation label set.
790790
source_result = await session.run(
791-
relation_query.format(endpoint_predicate="r.source IN $names"),
791+
relation_query.replace("{endpoint_predicate}", "r.source IN $names"),
792792
collection_id=self._collection_id,
793793
names=names,
794794
)
795795
await _consume(source_result)
796796
target_result = await session.run(
797-
relation_query.format(endpoint_predicate="r.target IN $names"),
797+
relation_query.replace("{endpoint_predicate}", "r.target IN $names"),
798798
collection_id=self._collection_id,
799799
names=names,
800800
)

0 commit comments

Comments
 (0)