I have some code where I convert a pandas dataframe into a dask dataframe and I apply some operations on the row. The code used to work just fine but it seems to crash now due to some internal error caused by dask. Does anyone know what the issue is?
Sample example:
import dask.dataframe as dd
x = pd.DataFrame(np.ones((4, 2)),columns=['a', 'b'])
df = dd.from_pandas(x, npartitions=2)
df.compute()
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-29-2d44a675e56f> in <module>
3 x = pd.DataFrame(np.ones((4, 2)),columns=['a', 'b'])
4 df = dd.from_pandas(x, npartitions=2)
----> 5 df.compute()
~/miniconda3/envs/research_env/lib/python3.9/site-packages/dask/base.py in compute(self, **kwargs)
282 dask.base.compute
283 """
--> 284 (result,) = compute(self, traverse=False, **kwargs)
285 return result
286
~/miniconda3/envs/research_env/lib/python3.9/site-packages/dask/base.py in compute(*args, **kwargs)
564 postcomputes.append(x.__dask_postcompute__())
565
--> 566 results = schedule(dsk, keys, **kwargs)
567 return repack([f(r, *a) for r, (f, a) in zip(results, postcomputes)])
568
~/miniconda3/envs/research_env/lib/python3.9/site-packages/distributed/client.py in get(self, dsk, keys, workers, allow_other_workers, resources, sync, asynchronous, direct, retries, priority, fifo_timeout, actors, **kwargs)
2652 Client.compute : Compute asynchronous collections
2653 """
-> 2654 futures = self._graph_to_futures(
2655 dsk,
2656 keys=set(flatten([keys])),
~/miniconda3/envs/research_env/lib/python3.9/site-packages/distributed/client.py in _graph_to_futures(self, dsk, keys, workers, allow_other_workers, priority, user_priority, resources, retries, fifo_timeout, actors)
2579 # Pack the high level graph before sending it to the scheduler
2580 keyset = set(keys)
-> 2581 dsk = dsk.__dask_distributed_pack__(self, keyset, annotations)
2582
2583 # Create futures before sending graph (helps avoid contention)
TypeError: __dask_distributed_pack__() takes 3 positional arguments but 4 were given