Skip to content

Native: an RID built from an RID keeps the text, so a find_nearest hit can be saved - #266

Merged
tae898 merged 1 commit into
mainfrom
fix/rid-of-rid
Nov 5, 2026
Merged

tae898 merged 1 commit into
mainfrom
fix/rid-of-rid

Conversation

@tae898

@tae898 tae898 commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

Closes #265

A hit of find_nearest(include_vector=True) carries the row's RID as its rid, and the native record wrappers wrap their rid again (RID(self._rid) in save, the update, delete, new_edge and the edge reads). RID.__init__ kept its argument as is, so .text was an RID, and the fast named-parameter path of codec.encode_params raised TypeError: Object of type RID is not JSON serializable on save. RID now unwraps an RID argument, which covers every call site at once.

File Change
src/arcadedb/_native/codec.py RID.__init__: self.text = text.text if isinstance(text, RID) else text
tests/test_native_rid_params.py new, native only: the constructor keeps the text; a wrapped RID encodes byte for byte like the RID on the fast named path (save, delete, new_edge) and on the hook paths (the update's rid and row, a positional RID), binary and text
tests/conftest.py collects the new file on the native backend only

Checks: both new tests fail on the codec.py of main (a53f9cd6cc: AssertionError on the constructor, TypeError on the encoder) and pass with this change, run engine-free against the two module files; test_vector_hit_records.py::test_a_hit_can_be_modified_and_saved[True] is the integration test that found it (red on #264's linux-x86_64 py3.12 parity leg) and should go green here. compile(), pyflakes and pre-commit pass. JVM build untouched. This blocks the 26.11.1 tag (#18).

🤖 Generated with Claude Code

…t can be saved

A hit of find_nearest(include_vector=True) carries the row's RID as its rid, and the native record wrappers wrap their rid again (RID(self._rid) in save, the update, delete, new_edge and the edge reads). RID.__init__ kept its argument as is, so .text was an RID and the fast named-parameter path of codec.encode_params raised 'Object of type RID is not JSON serializable' (test_vector_hit_records::test_a_hit_can_be_modified_and_saved[True], found on #264's parity leg); the slower paths sent a nested tag. RID now unwraps an RID argument. test_native_rid_params.py (native only) checks the constructor and that a wrapped RID encodes byte for byte like the RID on the fast and the hook paths; both tests fail on the previous codec.py and pass on this one (checked engine-free).

Closes #265

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tae898 tae898 added the bug Something isn't working label Nov 5, 2026
@tae898
tae898 merged commit 8fd3403 into main Nov 5, 2026
41 checks passed
@tae898
tae898 deleted the fix/rid-of-rid branch November 5, 2026 06:45
@github-actions github-actions Bot added this to the 26.11.1 milestone Nov 5, 2026
tae898 added a commit that referenced this pull request Nov 5, 2026
…uage

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

Native build: saving a find_nearest(include_vector=True) hit fails with 'Object of type RID is not JSON serializable'

1 participant