Dask futures nested in `OrderedDict` types are not resolved when using `submit`
- Dominant language
- Python
- Stars
- 1.7k
- Forks
- 778
- Avg merge
- 2h 50m
- Merged PRs (30d)
- 3
Description
**What happened**:
I'm passing a dask future to another delayed function call using `client.submit`. If the dask future is in a dictionary, it is resolved to a value when it reaches the function. If it is in an ordered dictionary, it remains a dask future.
**What you expected to happen**:
Futures nested in `OrderedDict` collections should be resolved to values
**Minimal Complete Verifiable Example**:
```python
from dask.distributed import Client
from collections import OrderedDict
def identity(x):
return x
def show(x):
print(repr(x))
if __name__ == "__main__":
with Client() as client:
f1 = client.submit(show, "hello")
f2 = client.submit(show, client.submit(identity, "hello"))
# Works
f3 = client.submit(show, {"key": client.submit(identity, "hello")})
# Does not work
f4 = client.submit(show, OrderedDict({"key": client.submit(identity, "hello")}))
_ = [f.result() for f in (f1, f2, f3, f4)]
```
```
'hello'
'hello'
{'key': 'hello'}
OrderedDict([('key', )])
```
**Anything else we need to know?**:
`unpack_collections` appears to support this, but I don't think it's used here.
```python
...
elif typ in (dict, OrderedDict):
tsk = (typ, [[_unpack(k), _unpack(v)] for k, v in expr.items()])
```
**Environment**:
- Dask version: 2021.8.1+18.gda2bcccc / master
- Python version: 3.7
- Operating System: OSX
- Install method (conda, pip, source): Source (also tested via pip)
Contributor guide
Assessment
This issue has not been assessed yet.