dask / dask/distributed

`Client.compute` doesn't materialize delayed chunk of persisted array if provided as a dict value

Open
#8,959 3 comments 2 reactions 0 assignees View on GitHub
bug regression
Dominant language
Python
Stars
1.7k
Forks
778
Avg merge
2h 50m
Merged PRs (30d)
3

Description

**Describe the issue**:
When persisting a dask array and trying to compute one of its chunks, the return value is the dask key instead of the computed array if the chunk is provided as a dict value.

**Minimal Complete Verifiable Example**:

```python
import dask.array as da
from dask.distributed import Client

if __name__ == '__main__':
client = Client()
X = da.random.random((100, 2), chunks=(100, 2)).persist()
delayed_chunk = X.to_delayed()[0, 0]
print(type(client.compute(delayed_chunk).result())) # numpy.ndarray
print(type(client.compute([delayed_chunk])[0].result())) # numpy.ndarray
print(type(client.compute({'x': delayed_chunk}).result()['x'])) # tuple (the dask key)
```

**Anything else we need to know?**:
On 2024.11.2 these all return an array.

**Environment**:

- Dask version: 2024.12.0
- Python version: 3.10.16
- Operating System: Ubuntu
- Install method (conda, pip, source): `pip install dask[distributed]`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.