Skip to content

Commit 1482ffc

Browse files
author
Nikos Papailiou
committed
Check if group contains member
1 parent 7f5de96 commit 1482ffc

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,12 @@ def __init__(
3636
ctx=self.ctx,
3737
config=config,
3838
)
39-
try:
39+
if storage_formats[self.storage_version]["IDS_ARRAY_NAME"] + self.index_version in self.group:
4040
self.ids_uri = self.group[
4141
storage_formats[self.storage_version]["IDS_ARRAY_NAME"] + self.index_version
4242
].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:
43+
self._ids = read_vector_u64(self.ctx, self.ids_uri, 0, 0)
44+
else:
4845
self._ids = StdVector_u64(np.arange(self.size).astype(np.uint64))
4946

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

0 commit comments

Comments
 (0)