langchain/libs/community/tests/integration_tests/graphs
German Martin 3a1d05394d
community: Apache AGE wrapper. Ensure Node Uniqueness by ID. (#28759)
**Description:**

The Apache AGE graph integration incorrectly handled node merging,
allowing duplicate nodes with different IDs but the same type and other
properties. Unlike
[Neo4j](cdf6202156/libs/community/langchain_community/graphs/neo4j_graph.py (L47)),
[Memgraph](cdf6202156/libs/community/langchain_community/graphs/memgraph_graph.py (L50)),
[Kuzu](cdf6202156/libs/community/langchain_community/graphs/kuzu_graph.py (L253)),
and
[Gremlin](cdf6202156/libs/community/langchain_community/graphs/gremlin_graph.py (L165)),
it did not use the node ID as the primary identifier for merging.

This inconsistency caused data integrity issues and unexpected behavior
when users expected updates to specific nodes by ID.

**Solution:**
This PR modifies the `node_insert_query` to `MERGE` nodes based on label
and ID *only* and updates properties with `SET`, aligning the behavior
with other graph database integrations. The `_format_properties` method
was also modified to handle id overrides.

**Impact:**

This fix ensures data integrity by preventing duplicate nodes, and
provides a consistent behavior across graph database integrations.
2024-12-17 09:21:59 -05:00
..
docker-compose-ontotext-graphdb langchain[minor], community[minor]: Implement Ontotext GraphDB QA Chain (#16019) 2024-01-29 12:25:53 -08:00
__init__.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00
test_age_graph.py community: Apache AGE wrapper. Ensure Node Uniqueness by ID. (#28759) 2024-12-17 09:21:59 -05:00
test_falkordb.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00
test_hugegraph.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00
test_kuzu.py community[patch]: Resolve KuzuQAChain API Changes (#16885) 2024-02-15 10:18:37 -08:00
test_memgraph.py community: update Memgraph integration (#27017) 2024-12-10 10:57:21 -05:00
test_nebulagraph.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00
test_neo4j.py Sanitize backticks from neo4j labels and types for import (#23367) 2024-06-24 19:05:31 +00:00
test_ontotext_graphdb_graph.py langchain[patch], community[patch]: Fixes in the Ontotext GraphDB Graph and QA Chain (#17239) 2024-02-08 12:05:43 -08:00