From 0dd4560a89a3668c5655eec4ffcb6ca3f2db143a Mon Sep 17 00:00:00 2001 From: Taewoon Kim Date: Thu, 29 Oct 2026 08:13:23 +0900 Subject: [PATCH] Vector rows: read the record from the row itself when the engine flattens it (ArcadeDB #10898) ArcadeDB 26.11.1 (#10900) lists a vector row's record properties once, on the row, and no longer enumerates "record". Native _run_search falls back to the row (minus distance) when "record" is absent, so find_nearest keeps returning records; the approximate-persistence test accepts both engine shapes and now also checks @rid and the embedding. Closes #128 Co-Authored-By: Claude Opus 5.5 --- src/arcadedb/_native/schema_objects.py | 4 ++++ tests/test_vector.py | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/arcadedb/_native/schema_objects.py b/src/arcadedb/_native/schema_objects.py index c795af0..eb53a7d 100644 --- a/src/arcadedb/_native/schema_objects.py +++ b/src/arcadedb/_native/schema_objects.py @@ -207,6 +207,10 @@ def _run_search( out = [] for row in rows: nested = row.get("record") + if nested is None and row.get("@rid") is not None: + # From ArcadeDB 26.11.1 (ArcadeData/arcadedb#10898) a vector row lists the record's + # properties once, on the row itself, and no longer under "record" + nested = {k: v for k, v in row.to_dict().items() if k != "distance"} record = ( None if nested is None diff --git a/tests/test_vector.py b/tests/test_vector.py index 2dbef2b..c0c181a 100644 --- a/tests/test_vector.py +++ b/tests/test_vector.py @@ -603,7 +603,11 @@ def test_lsm_vector_search_approximate_persistence(self, tmp_path): vertex = neighbors[0] assert vertex is not None assert isinstance(vertex, dict) - assert vertex.get("record") is not None + # ArcadeDB 26.11.1 (ArcadeData/arcadedb#10898) lists the record's properties on the row + # once; earlier engines nested them under "record". Either way the record is there. + record = vertex.get("record") or vertex + assert record.get("@rid") is not None + assert record.get("embedding") == [1.0, 0.0, 0.0] assert vertex.get("distance") is not None def test_lsm_vector_build_graph_now(self, test_db):