Evgeny Ivanov
11/10/2022, 3:34 PMThen, register to view the block on Prefect Cloud:
But there is no moduleCopy codeprefect block register -m prefect_dask.credentials
credentials
in prefect_dask
. And I get the following error (not a surpirse):
```Unable to load prefect_dask.credentials. Please make sure the module is installed in your current
environment.```I wonder if this module has ever existed? Or maybe there are plans to create it?
Khuyen Tran
11/10/2022, 4:11 PMNate
11/10/2022, 4:19 PMEvgeny Ivanov
11/11/2022, 6:36 AMclass DaskTaskRunnerConfig(Block):
"""Dask Task Runner Config.
Attributes:
address (str, optional): Address of a currently running dask scheduler;
if one is not provided, a temporary cluster will be created in
`DaskTaskRunner.start()`. Defaults to `None`.
cluster_class (str, optional): The cluster class to use when creating
a temporary dask cluster. Should be the full class name
(e.g. `"distributed.LocalCluster"`).
cluster_kwargs (dict, optional): Additional kwargs to pass to the
`cluster_class` when creating a temporary dask cluster.
adapt_kwargs (dict, optional): Additional kwargs to pass to
`cluster.adapt` when creating a temporary dask cluster. Note that
adaptive scaling is only enabled if `adapt_kwargs` are provided.
client_kwargs (dict, optional): Additional kwargs to use when creating a
`dask.distributed.Client`,
<https://distributed.dask.org/en/latest/api.html#client>.
"""
_block_type_name = 'Dask Task Runner Config'
address: str | None = None
cluster_class: str | None = None
cluster_kwargs: dict | None = None
adapt_kwargs: dict | None = None
client_kwargs: dict | None = None
def create_task_runner(self) -> DaskTaskRunner:
return DaskTaskRunner(
address=self.address,
cluster_class=self.cluster_class,
cluster_kwargs=self.cluster_kwargs,
adapt_kwargs=self.adapt_kwargs,
client_kwargs=self.client_kwargs,
)
Andrew Huang
11/11/2022, 5:14 PM