Skip to content

Commit 18fc5f4

Browse files
author
Nikos Papailiou
committed
Fix empty read slices
1 parent 573b070 commit 18fc5f4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -940,11 +940,15 @@ def consolidate_partition_udf(
940940
for partition_slice in partition_slices[p]:
941941
read_slices.append(partition_slice)
942942

943+
start_pos = int(index_array[part]["values"])
944+
end_pos = int(index_array[part_end]["values"])
945+
if len(read_slices) == 0:
946+
if start_pos != end_pos:
947+
raise ValueError("Incorrect partition size.")
948+
continue
943949
logger.debug(f"Read slices: {read_slices}")
944950
ids = partial_write_array_ids_array.multi_index[read_slices]["values"]
945951
vectors = partial_write_array_parts_array.multi_index[:, read_slices]["values"]
946-
start_pos = int(index_array[part]["values"])
947-
end_pos = int(index_array[part_end]["values"])
948952

949953
logger.debug(
950954
f"Ids shape {ids.shape}, expected size: {end_pos - start_pos} expected range:({start_pos},{end_pos})")

0 commit comments

Comments
 (0)