Cluster does not allow an asynchronous client
Implementing an asynchronous client is useful when combining dask with e.g. adaptive. However, the current version of dask_qt fails when calling such client.
Minimal example:
options = cluster_options()
options.worker_cores = 2
options.worker_memory = 2
cluster= Cluster(options, asynchronous=True)
client = cluster.get_client()
Traceback:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Input In [3], in <cell line: 3>()
1 # this fails
2 cluster= Cluster(options, asynchronous=True)
----> 3 client = cluster.get_client()
File /opt/conda/lib/python3.10/site-packages/dask_gateway/client.py:1079, in GatewayCluster.get_client(self, set_as_default)
1072 def get_client(self, set_as_default=True):
1073 """Get a ``Client`` for this cluster.
1074
1075 Returns
1076 -------
1077 client : dask.distributed.Client
1078 """
-> 1079 client = Client(
1080 self,
1081 security=self.security,
1082 set_as_default=set_as_default,
1083 asynchronous=self.asynchronous,
1084 loop=self.loop,
1085 )
1086 if not self.asynchronous:
1087 self._clients.add(client)
File /opt/conda/lib/python3.10/site-packages/distributed/client.py:845, in Client.__init__(self, address, loop, timeout, set_as_default, scheduler_file, security, asynchronous, name, heartbeat_interval, serializers, deserializers, extensions, direct_to_workers, connection_limit, **kwargs)
843 security = getattr(self.cluster, "security", None)
844 elif address is not None and not isinstance(address, str):
--> 845 raise TypeError(
846 "Scheduler address must be a string or a Cluster instance, got {}".format(
847 type(address)
848 )
849 )
851 # If connecting to an address and no explicit security is configured, attempt
852 # to load security credentials with a security loader (if configured).
853 if security is None and isinstance(address, str):
TypeError: Scheduler address must be a string or a Cluster instance, got <class 'dask_quantumtinkerer.client.Cluster'>
It seems that dask-gateway
does not recognizes the cluster instance of dask_qt as such.