Aman Agarwal
Aman Agarwal

Reputation: 43

TypeError when awaiting dask futures

I get the following error: TypeError: object list can't be used in 'await' expression

when I try to await futures as dask_client.gather(futures) or await futures.

I am using a Dask Client with asynchronous=True

Tried referring to the official docs https://distributed.dask.org/en/stable/asynchronous.html

Upvotes: 1

Views: 178

Answers (1)

Aman Agarwal
Aman Agarwal

Reputation: 43

Adding asynchronous=True while initialising the dask client is not enough when you want to gather or wait for all futures to finish executing. asynchronous=True argument has to be passed to the gather method as well.

await dask_client.gather(futures, asynchronous=True)

Upvotes: 3

Related Questions