Repository navigation
Record ids in rows: tests and docs for the RID contract - #49
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A record id inside a row is the engine's own
RIDthrough JPype, and its behaviour was never pinned: nothing tested whatstr(rid), equality, ordering or passing it back as a parameter do. This PR addstests/test_record_id_values.py(12 tests) and a "Record ids in rows" section in the "Databases and queries" page, and says in thelookup_by_riddocstring 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, aLINKproperty, 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()andisValid()work; it goes back in as a query parameter and tolookup_by_rid()as itself or as its text;get_rid()is text orNone(a record row, anexpand()row and an unaliased@ridprojection have one).rid == "#10:5"is not part of the contract, so the docs say to comparestr(rid).Local checks: the source tree was run with the jars and JRE of an installed
arcadedb-embedded26.11.1.dev0 wheel linked intosrc/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.py96 passed; black, isort and bandit clean on the new test file and oncore.py. Not run: the full suite, the docs build, CI.🤖 Generated with Claude Code