prefect_dask.utils
Utils to use alongside prefect-dask.
Functions
get_dask_client
dask.DataFrame or dask.Bag.
Without invoking this, workers do not automatically get a client to connect
to the full cluster. Therefore, it will attempt perform work within the
worker itself serially, and potentially overwhelming the single worker.
When in an async context, we recommend using get_async_dask_client instead.
Args:
timeout: Timeout after which to error out; has no effect in flow run contexts because the client has already started; Defaults to thedistributed.comm.timeouts.connectconfiguration value.client_kwargs: Additional keyword arguments to pass todistributed.Client, and overwrites inherited keyword arguments from the task runner, if any.
get_dask_client to distribute work across workers.
get_async_dask_client
dask.DataFrame or dask.Bag.
Without invoking this, workers do not automatically get a client to connect
to the full cluster. Therefore, it will attempt perform work within the
worker itself serially, and potentially overwhelming the single worker.
Args:
timeout: Timeout after which to error out; has no effect in flow run contexts because the client has already started; Defaults to thedistributed.comm.timeouts.connectconfiguration value.client_kwargs: Additional keyword arguments to pass todistributed.Client, and overwrites inherited keyword arguments from the task runner, if any.
get_async_dask_client to distribute work across workers.