feat: make upsert_edge type-aware with property update support#25
Open
anonenity wants to merge 3 commits intocolliery-io:mainfrom
Open
feat: make upsert_edge type-aware with property update support#25anonenity wants to merge 3 commits intocolliery-io:mainfrom
anonenity wants to merge 3 commits intocolliery-io:mainfrom
Conversation
upsert_edge now checks for edges of the same relationship type rather than any edge between two nodes, allowing multiple relationship types between the same node pair. Existing edges are updated via SET (merge semantics) instead of being silently skipped.
504435f to
1ffca22
Compare
Now that upsert_edge supports multiple relationship types between the same node pair, has_edge/get_edge/delete_edge need an optional rel_type parameter to address edges individually. These tests document the expected API and currently fail with TypeError.
Contributor
|
Hey @anonenity — nice fix, the type-aware MERGE approach is the right call. I pushed a commit with three failing tests that highlight an API gap opened up by this change:
All three fail with |
Adds an optional rel_type parameter to get_edge, has_edge, and delete_edge in both Rust and Python bindings so callers can target a specific relationship type. Without rel_type, behaviour is unchanged (wildcard match).
Author
|
Hey @dylanbstorey, thanks! All three tests passing now. Agreed, type-aware MERGE is right here. Added optional |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
upsert_edgenow checks for edges of the same relationship type before deciding to create or update, instead of checking for any edge between two nodesSET(merge semantics), preserving properties not included in the updateProblem
Previously,
upsert_edgecalledhas_edge(source, target)which matched any edge type. This caused two bugs:upsert_edgewould see the first edge and silently no-op