Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion distributed/protocol/numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def serialize_numpy_ndarray(x):

data = x.view('u1').data

if blosc and data.nbytes > 1e5:
if blosc and x.nbytes > 1e5:
frames = frame_split_size([data])
if sys.version_info.major == 2:
frames = [ensure_bytes(frame) for frame in frames]
Expand Down
3 changes: 2 additions & 1 deletion distributed/protocol/tests/test_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,5 @@ def test_dont_compress_uncompressable_data():
x = np.ones(100)
header, [data] = serialize(x)
assert 'compression' not in header
assert data.obj.ctypes.data == x.ctypes.data
if isinstance(data, memoryview):
assert data.obj.ctypes.data == x.ctypes.data