Skip to content

Record ids in rows: tests and docs for the RID contract - #49

Merged
tae898 merged 1 commit into
mainfrom
parity/record-id-values
Oct 25, 2026
Merged

tae898 merged 1 commit into
mainfrom
parity/record-id-values

Conversation

@tae898

@tae898 tae898 commented Oct 25, 2026

Copy link
Copy Markdown
Collaborator

A record id inside a row is the engine's own RID through JPype, and its behaviour was never pinned: nothing tested what str(rid), equality, ordering or passing it back as a parameter do. This PR adds tests/test_record_id_values.py (12 tests) and a "Record ids in rows" section in the "Databases and queries" page, and says in the lookup_by_rid docstring that it also takes the RID object a row holds. No behaviour changes. It is the port of humemai/arcadedb-embedded-python#530, where the same contract is also being matched on the native wheel.

The contract: a record id in a row value (SELECT @rid, a LINK property, a list of links) is an RID object; str(rid) is the text; RIDs of one record are equal and hash alike; RIDs sort by bucket and position; getBucketId(), getPosition(), toString() and isValid() work; it goes back in as a query parameter and to lookup_by_rid() as itself or as its text; get_rid() is text or None (a record row, an expand() row and an unaliased @rid projection have one). rid == "#10:5" is not part of the contract, so the docs say to compare str(rid).

Local checks: the source tree was run with the jars and JRE of an installed arcadedb-embedded 26.11.1.dev0 wheel linked into src/arcadedb (this repo's own wheel was not built here, so this is not the "tests run against the built wheel" path): tests/test_record_id_values.py, test_core.py, test_resultset.py, test_graph_api.py 96 passed; black, isort and bandit clean on the new test file and on core.py. Not run: the full suite, the docs build, CI.

🤖 Generated with Claude Code

A record id inside a row (SELECT @Rid, a LINK property, a list of links) is an RID object: str() is the text, equal RIDs hash alike, RIDs sort by bucket and position, getBucketId/getPosition/toString/isValid work, and an RID goes back in as a query parameter and to lookup_by_rid. get_rid() is text. The behaviour is already the engine's own RID through JPype; this adds the test file (12 tests) and a docs section, and says that lookup_by_rid also takes the RID object a row holds. rid == "#10:5" is deliberately not part of the contract.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@tae898
tae898 marked this pull request as ready for review October 25, 2026 08:54
@tae898
tae898 merged commit d8d300b into main Oct 25, 2026
29 checks passed
@tae898
tae898 deleted the parity/record-id-values branch October 25, 2026 09:27
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