From d44b025b66449b23f778710b62e1a1363f46e481 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Fri, 3 Dec 2021 23:26:57 -0600 Subject: [PATCH] [python-package] [dask] fix mypy error about worker_addresses --- python-package/lightgbm/dask.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python-package/lightgbm/dask.py b/python-package/lightgbm/dask.py index f1b10ff43b31..a12203170e4f 100644 --- a/python-package/lightgbm/dask.py +++ b/python-package/lightgbm/dask.py @@ -349,7 +349,7 @@ def _split_to_parts(data: _DaskCollection, is_matrix: bool) -> List[_DaskPart]: return parts -def _machines_to_worker_map(machines: str, worker_addresses: List[str]) -> Dict[str, int]: +def _machines_to_worker_map(machines: str, worker_addresses: Iterable[str]) -> Dict[str, int]: """Create a worker_map from machines list. Given ``machines`` and a list of Dask worker addresses, return a mapping where the keys are @@ -360,7 +360,7 @@ def _machines_to_worker_map(machines: str, worker_addresses: List[str]) -> Dict[ machines : str A comma-delimited list of workers, of the form ``ip1:port,ip2:port``. worker_addresses : list of str - A list of Dask worker addresses, of the form ``{protocol}{hostname}:{port}``, where ``port`` is the port Dask's scheduler uses to talk to that worker. + An iterable of Dask worker addresses, of the form ``{protocol}{hostname}:{port}``, where ``port`` is the port Dask's scheduler uses to talk to that worker. Returns -------