Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion apis/python/src/tiledb/vector_search/ingestion.py
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,8 @@ def read_input_vectors(
) as src_array:
src_array_schema = src_array.schema
data = src_array[start_pos:end_pos, 0:dimensions]
return coo_matrix(

matrix = coo_matrix(
(
data[src_array_schema.attr(0).name],
(
Expand All @@ -950,6 +951,15 @@ def read_input_vectors(
),
)
).toarray()

if matrix.shape[1] < dimensions:
matrix = np.concatenate([
matrix,
np.zeros(shape=(matrix.shape[0], dimensions - matrix.shape[1]))
], axis=1)

return matrix

elif source_type == "TILEDB_PARTITIONED_ARRAY":
with tiledb.open(
source_uri, "r", timestamp=index_timestamp, config=config
Expand Down