Skip to content

fix(core): update existing property graph relations on upsert - #23680

Draft
emme1t wants to merge 2 commits into
run-llama:mainfrom
emme1t:fix/property-graph-relation-upserts-20261023
Draft

emme1t wants to merge 2 commits into
run-llama:mainfrom
emme1t:fix/property-graph-relation-upserts-20261023

Conversation

@emme1t

@emme1t emme1t commented Oct 23, 2026

Copy link
Copy Markdown

Description

Fixes #23679.

SimplePropertyGraphStore.upsert_relations() currently ignores updated properties when a relation's (source, label, target) already exists. For example, upserting a KNOWS relation with confidence 0.1 and then 0.9 still returns 0.1.

Remove the early return in LabelledPropertyGraph.add_triplet() so node/relation mappings receive the latest objects. The existing triplet set continues to prevent duplicates, including repeated identical upserts. add_node() already replaces nodes by identity.

Validation

  • Unchanged main 619d74664: 2 failed, 8 passed in tests/graph_stores/test_simple_lpg.py; both new sync/async update cases return the stale confidence.
  • After the fix: PYTHONPATH=$PWD python -m pytest tests/graph_stores -q --tb=short: 10 passed.
  • Tests cover updated relation properties, preserved endpoint properties, unrelated relations between the same endpoints, stable relation/triplet counts, and replay of the updated relation.
  • Ruff check/format check and git diff --check: passed.
  • Targeted mypy with --follow-imports=skip on both changed files: passed. Full repository typechecking/CI was not run locally.

No dependency or core version change. Separate from shared-endpoint deletion (#23347) and relation-key collisions (#23437).

AI assistance was used for investigation, implementation and regression tests. Verified both baseline failures, reviewed the set/mapping update behavior, and ran the checks above. Submitted as draft for human review.

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.

[Bug]: SimplePropertyGraphStore relation upserts ignore updated properties

1 participant