Skip to content

fix: Edge.__eq__ checks isinstance(other, Edge) not Node#1593

Open
totto wants to merge 1 commit into
getzep:mainfrom
totto:fix/edge-eq-isinstance-check
Open

fix: Edge.__eq__ checks isinstance(other, Edge) not Node#1593
totto wants to merge 1 commit into
getzep:mainfrom
totto:fix/edge-eq-isinstance-check

Conversation

@totto

@totto totto commented Jun 17, 2026

Copy link
Copy Markdown

What

Edge.__eq__ compared the other object against Node instead of Edge, making edge equality always return False when comparing two edges.

Why it matters

Any code that deduplicates, checks membership in a set, or compares edges directly silently fails. For example:

edge_a = EntityEdge(uuid="abc", ...)
edge_b = EntityEdge(uuid="abc", ...)
edge_a == edge_b  # False — wrong, same UUID
{edge_a} == {edge_b}  # False

Fix

One character: NodeEdge in the isinstance check.

Test

from graphiti_core.edges import EntityEdge

e1 = EntityEdge.__new__(EntityEdge)
e1.uuid = "test-uuid"
e2 = EntityEdge.__new__(EntityEdge)
e2.uuid = "test-uuid"
assert e1 == e2          # was False, now True
assert not (e1 == "x")  # still False for non-Edge

Edge equality was always False when comparing two Edge instances because
the type guard checked for Node instead of Edge. This meant deduplication,
set membership, and any equality check between edges silently failed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@zep-cla-assistant

Copy link
Copy Markdown
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. For privacy information, see our Privacy Notice. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA behalf on myself, e-mail: example@example.com

or

I have read the CLA Document and I hereby sign the CLA behalf of my company, e-mail: example@example.com

Signature is valid for 6 months.


This bot will be retriggered when the Contributor License Agreement comment has been provided. Posted by the CLA Assistant Lite bot.

@totto

totto commented Jun 17, 2026

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA behalf on myself, e-mail: totto@exoreaction.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant