client.get_futures_error returns wrong values with keyword in `dask.delayed`
- Dominant language
- Python
- Stars
- 1.7k
- Forks
- 778
- Avg merge
- 2h 50m
- Merged PRs (30d)
- 3
Description
`client.get_futures_error` returns incorrect function and arguments if a keyword is given to a `dask.delayed` function.
Running the following code:
```python
from dask.distributed import Client, LocalCluster, progress, futures_of
import dask
from time import sleep
from toolz.itertoolz import groupby
from toolz.dicttoolz import valmap
def function(i, attempt=1):
raise ValueError
return i
def get_status(obj):
return obj.status
if __name__ == '__main__':
scheduler_url = 'localhost:8786'
cluster = LocalCluster()
client = Client(cluster)
tasks = []
for mapping_el in range(1):
tasks.append(dask.delayed(function)(mapping_el, attempt=1))
results = client.compute(tasks)
futures = futures_of(results)
while True:
task_status = groupby(get_status, futures)
task_lenghts = valmap(len, task_status)
if 'pending' not in task_lenghts:
break
sleep(0.5)
print(client.get_futures_error(futures[0]))
client.restart()
tasks = []
for mapping_el in range(1):
tasks.append(dask.delayed(function)(mapping_el))
results = client.compute(tasks)
futures = futures_of(results)
while True:
task_status = groupby(get_status, futures)
task_lenghts = valmap(len, task_status)
if 'pending' not in task_lenghts:
break
sleep(0.5)
print(client.get_futures_error(futures[0]))
```
produces:
```
distributed.worker - WARNING - Compute Failed
Function: execute_task
args: ((, , [0], (, [['attempt', 1]])))
kwargs: {}
Exception: ValueError()
(, ((, , [0], (, [['attempt', 1]])),), {}, [])
distributed.worker - WARNING - Compute Failed
Function: function
args: (0)
kwargs: {}
Exception: ValueError()
(, (0,), {}, [])
```
Contributor guide
Assessment
This issue has not been assessed yet.