Skip to content

Commit a6f4fdc

Browse files
authored
Explicitly set the numpy type in _write_array (#2128)
`QueryExperimental::set_data_buffer` requires an unsigned integer as its last argument. It seems that with numpy versions earlier than 2, this argument becomes a numpy float64 (with `buffer_sizes[i]` being a numpy uint64 and `ncells` being a Python int). Let's fix it by explicitly cast to numpy uint64. Closes #2127, closes #2124.
1 parent 600d374 commit a6f4fdc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tiledb/array.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ def _write_array(
899899
q.set_data_buffer(
900900
buffer_name,
901901
output_values[i],
902-
buffer_sizes[i] * ncells,
902+
np.uint64(buffer_sizes[i] * ncells),
903903
)
904904

905905
# Set offsets buffer

0 commit comments

Comments
 (0)