https://prefect.io logo
Title
m

Mia

06/02/2022, 8:49 PM
Hi, i’m having issues trying to use LocalDaskExecutor(scheduler=“threads”) with map(). When I try to call in flow,
foo.map(list_custom_class)
, i get an error like the following:
Unexpected error: AttributeError("'ThreadPoolExecutor' object has no attribute 'apply_async'")
Traceback (most recent call last):
  File "/miniconda3/lib/python3.7/site-packages/prefect/engine/runner.py", line 48, in inner
    new_state = method(self, state, *args, **kwargs)
  File "/miniconda3/lib/python3.7/site-packages/prefect/engine/flow_runner.py", line 543, in get_flow_run_state
    {e: state for e, state in upstream_states.items()}
  File "/miniconda3/lib/python3.7/site-packages/prefect/executors/dask.py", line 711, in wait
    futures, scheduler=self.scheduler, pool=self._pool, optimize_graph=False
  File "/miniconda3/lib/python3.7/site-packages/dask/base.py", line 447, in compute
    results = schedule(dsk, keys, **kwargs)
  File "/miniconda3/lib/python3.7/site-packages/dask/threaded.py", line 77, in get
    pool.apply_async,
AttributeError: 'ThreadPoolExecutor' object has no attribute 'apply_async'
What could be causing this error?
k

Kevin Kho

06/02/2022, 8:51 PM
What is your dask version?
pip show dask
?
m

Mia

06/02/2022, 8:57 PM
Name: dask Version: 2.21.0 Summary: Parallel PyData with Task Scheduling Home-page: https://github.com/dask/dask/ Author: Author-email: License: BSD Location: /miniconda3/lib/python3.7/site-packages Requires: pyyaml Required-by: prefect, distributed, dask-jobqueue
k

Kevin Kho

06/02/2022, 8:58 PM
I think your Dask version is 2 years old. Can you try something more recent?
1
m

Mia

06/02/2022, 9:00 PM
hm i see