Skip to content

Commit 488d003

Browse files
tae898claude
andcommitted
Native get_metadata: rerank_oversample and fused_pq follow the engine, as on the JVM build
The base added these two keys to the JVM get_metadata when the engine has them (hasattr). The image links engine 26.10.2, which has not, so the native dict carries them only when the glue reports them; the shared test accepts them as optional. The glue reports them with the move to 26.11.1. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent e1dd64e commit 488d003

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

‎src/arcadedb/_native/schema_objects.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,8 @@ def get_metadata(self):
303303
"type_name": info["type_name"],
304304
"vector_property": self._shim._prop,
305305
**{k: info[k] for k in _METADATA_KEYS},
306+
# present when the engine the image links has them, as on the JVM build (26.10.2 has not; the glue emits them from 26.11.1 on)
307+
**{k: info[k] for k in _OPTIONAL_METADATA_KEYS if k in info},
306308
}
307309

308310
def get_quantization(self):
@@ -330,6 +332,7 @@ def get_quantization(self):
330332
"typeIndexName",
331333
}
332334
)
335+
_OPTIONAL_METADATA_KEYS = ("rerank_oversample", "fused_pq")
333336
_METADATA_KEYS = (
334337
"dimensions",
335338
"similarity_function",

‎tests/test_vector_index_introspection.py‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ def _insert(db, rows):
5656
PQ_VECTORS = UNIT_VECTORS + [("w", [-1.0, 0.0, 0.0])]
5757

5858

59+
# the engine reports these two only from 26.11.1 on, on both builds
60+
OPTIONAL_METADATA_KEYS = {"rerank_oversample", "fused_pq"}
61+
62+
5963
class TestGetStats:
6064
def test_counters_start_at_zero_and_track_inserts(self, temp_db):
6165
_make_type(temp_db)
@@ -121,13 +125,13 @@ def test_metadata_after_reopen_equals_the_creating_session(self, temp_db_path):
121125
beam_width=64,
122126
add_hierarchy=False,
123127
)
124-
assert set(created) == METADATA_KEYS
128+
assert set(created) - OPTIONAL_METADATA_KEYS == METADATA_KEYS
125129

126130
with arcadedb.open_database(temp_db_path) as db:
127131
index = db.schema.get_vector_index("Doc", "embedding")
128132
reopened = index.get_metadata()
129133

130-
assert set(reopened) == METADATA_KEYS
134+
assert set(reopened) - OPTIONAL_METADATA_KEYS == METADATA_KEYS
131135
assert reopened["dimensions"] == 4
132136
assert reopened["similarity_function"] == "EUCLIDEAN"
133137
assert reopened["id_property"] == "name"

0 commit comments

Comments
 (0)