Skip to content

Commit 7f5de96

Browse files
author
Nikos Papailiou
committed
Fix missing flat ids
1 parent ba91a70 commit 7f5de96

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

apis/python/src/tiledb/vector_search/flat_index.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,15 @@ def __init__(
3636
ctx=self.ctx,
3737
config=config,
3838
)
39-
self.ids_uri = self.group[
40-
storage_formats[self.storage_version]["IDS_ARRAY_NAME"] + self.index_version
41-
].uri
42-
if tiledb.array_exists(self.ids_uri, self.ctx):
43-
self._ids = read_vector_u64(self.ctx, self.ids_uri, 0, 0)
44-
else:
39+
try:
40+
self.ids_uri = self.group[
41+
storage_formats[self.storage_version]["IDS_ARRAY_NAME"] + self.index_version
42+
].uri
43+
if tiledb.array_exists(self.ids_uri, self.ctx):
44+
self._ids = read_vector_u64(self.ctx, self.ids_uri, 0, 0)
45+
else:
46+
self._ids = StdVector_u64(np.arange(self.size).astype(np.uint64))
47+
except tiledb.TileDBError:
4548
self._ids = StdVector_u64(np.arange(self.size).astype(np.uint64))
4649

4750
dtype = self.group.meta.get("dtype", None)

0 commit comments

Comments
 (0)