Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

community: Apache AGE wrapper. Ensure Node Uniqueness by ID. #28759

Conversation

GMartin-dev
Copy link
Contributor

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, Memgraph, Kuzu, and Gremlin, 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.

Copy link

vercel bot commented Dec 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Dec 17, 2024 6:56am

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. community Related to langchain-community 🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature labels Dec 17, 2024
@GMartin-dev GMartin-dev changed the title community: Apache AGE wrapper. Ensure Node Uniqueness by ID in Apache AGE Integration. community: Apache AGE wrapper. Ensure Node Uniqueness by ID. Dec 17, 2024
@dosubot dosubot bot added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label Dec 17, 2024
@ccurme ccurme merged commit 3a1d053 into langchain-ai:master Dec 17, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature community Related to langchain-community lgtm PR looks good. Use to confirm that a PR is ready for merging. size:S This PR changes 10-29 lines, ignoring generated files.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants