Skip to content

Commit 02d6120

Browse files
author
Bryan Lawrence
committed
Fixed the regression wrt files with no chunking introduced by thread safety.
1 parent 39884bc commit 02d6120

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

activestorage/active.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -261,13 +261,12 @@ def _get_selection(self, ds, *args):
261261

262262
indexer = pyfive.OrthogonalIndexer(*args, array)
263263
out_shape = indexer.shape
264-
out_dtype =ds.dtype
265264
#stripped_indexer = [(a, b, c) for a,b,c in indexer]
266265
drop_axes = indexer.drop_axes and keepdims
267266

268267
# we use array._chunks rather than ds.chunks, as the latter is none in the case of
269268
# unchunked data, and we need to tell the storage the array dimensions in this case.
270-
return self._from_storage(ds, indexer, array._chunks, out_shape, out_dtype, compressor, filters, drop_axes)
269+
return self._from_storage(ds, indexer, array._chunks, out_shape, dtype, compressor, filters, drop_axes)
271270

272271
def _from_storage(self, ds, indexer, chunks, out_shape, out_dtype, compressor, filters, drop_axes):
273272
method = self.method
@@ -303,7 +302,9 @@ def _from_storage(self, ds, indexer, chunks, out_shape, out_dtype, compressor, f
303302
# Because we do this, we need to read the dataset b-tree now, not as we go, so
304303
# it is already in cache. If we remove the thread pool from here, we probably
305304
# wouldn't need to do it before the first one.
306-
ds._get_chunk_addresses()
305+
306+
if ds.chunks is not None:
307+
ds._get_chunk_addresses()
307308
with concurrent.futures.ThreadPoolExecutor(max_workers=self._max_threads) as executor:
308309
futures = []
309310
# Submit chunks for processing.

bnl/bnl_test.py

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ def mytest():
2828
else:
2929
d = active[4:5, 1:2]
3030
mean_result = np.mean(d)
31-
3231
active = Active(uri, v, None)
3332
active._version = 2
3433
active.method = "mean"

0 commit comments

Comments
 (0)