Skip to content

fix(#421): JVM new_edges takes a vertex or document as new_edge does - #424

Merged
tae898 merged 1 commit into
ArcadeData:mainfrom
shaunpatterson:fix/new-edges-record-objects
Nov 22, 2026
Merged

tae898 merged 1 commit into
ArcadeData:mainfrom
shaunpatterson:fix/new-edges-record-objects

Conversation

@shaunpatterson

Copy link
Copy Markdown
Contributor

What does this PR do?

GraphBatch.new_edges on the JVM wheel wrote each source and destination with str(). A Vertex or Document has only a __repr__, so it became "<Vertex rid=#1:0 type=V>" and the engine refused it as an invalid RID, while new_edge and the native wheel's new_edges accept the object.

new_edges now reads the RID of a record wrapper with get_rid() (as _native/extras.py does) and keeps str() for a string or a Java RID. The text is made before anything is buffered, and the per-edge fallbacks still receive the original objects. The docstring now says what is accepted.

Related issues

Closes #421

Performance changes

None claimed. The check is one getattr per RID on a path that already builds one string per RID.

Docs

The new_edges docstring. No page under docs/ describes the accepted RID forms.

Checklist

  • A regression test fails on the old code and passes on the new (test_new_edges_takes_vertex_objects_as_new_edge_does, with and without properties, mixing vertices, RID strings and a Java RID; it also passes on the published native wheel 26.11.1.post4)
  • The test suite that the change can affect passes (every tests/ file that uses new_edges or graph_batch, 942 tests on the JVM wheel, the test_native_* files excluded as conftest.py does)
  • uvx pre-commit run --files <changed files> passes

…edge does

new_edges wrote each source and destination with str(), so a Vertex became its repr and the engine
refused it as an RID. It now reads the RID of a record wrapper with get_rid(), as the native wheel does,
and keeps str() for a string or a Java RID.
@tae898
tae898 merged commit 0c94079 into ArcadeData:main Nov 22, 2026
44 checks passed
@github-actions github-actions Bot added this to the 26.12.1 milestone Nov 22, 2026
@tae898 tae898 added the bug Something isn't working label Nov 22, 2026
@tae898

tae898 commented Nov 22, 2026

Copy link
Copy Markdown
Collaborator

Thank you, merged for 26.12.1.

@tae898 tae898 mentioned this pull request Nov 30, 2026
1 of 10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JVM GraphBatch.new_edges refuses a Vertex object that new_edge and the native wheel accept

2 participants