Skip to content

Commit 7f5bb0e

Browse files
committed
Cleanup.
1 parent bbf8dc1 commit 7f5bb0e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

python-package/xgboost/dask.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@
3434
from .sklearn import XGBModel, XGBRegressorBase, XGBClassifierBase
3535
from .sklearn import xgboost_model_doc
3636

37+
try:
38+
from distributed import Client
39+
except ImportError:
40+
Client = None
41+
3742
# Current status is considered as initial support, many features are
3843
# not properly supported yet.
3944
#
@@ -360,7 +365,7 @@ def get_worker_data_shape(self, worker):
360365
cols = c
361366
return (rows, cols)
362367

363-
from distributed import Client
368+
364369
def _get_rabit_args(worker_map, client: Client, host_ip=None, port=None):
365370
'''Get rabit context arguments from data distribution in DaskDMatrix.'''
366371
msg = 'Please provide both IP and port'

0 commit comments

Comments
 (0)