Commit bf0adf22 authored by Kirill Smelkov's avatar Kirill Smelkov

erp5_wendelin: Fix thinko in DataStream_copyCSVToDataArray() ZBigArray init

When we conditionally create new BigArray for appending data, we should create
it as empty, because in DataStream_copyCSVToDataArray() creation is done lazily
only when destination array is not yet initialized and we anyway append data to
the array in the following code block.

Creating BigArray with initial shape of appending part will result in
destination array being longer than neccessary by first-appended-chunk length
with this-way-introduced extra header reading as all zeros.

Fix it.

/cc @Tyagov
parent 88a2f8fe
......@@ -42,7 +42,7 @@ def DataStream_copyCSVToDataArray(self, chunk_list, start, end, \
zarray = data_array.getArray()
if zarray is None:
# first time init
zarray = ZBigArray(ndarray.shape, ndarray.dtype)
zarray = ZBigArray((0,), ndarray.dtype)
data_array.setArray(zarray)
zarray = data_array.getArray()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment