[CI] Workaround mypy errors. (#10754)
This commit is contained in:
@@ -1634,7 +1634,7 @@ class DaskScikitLearnBase(XGBModel):
|
|||||||
if isinstance(predts, dd.DataFrame):
|
if isinstance(predts, dd.DataFrame):
|
||||||
predts = predts.to_dask_array()
|
predts = predts.to_dask_array()
|
||||||
else:
|
else:
|
||||||
test_dmatrix = await DaskDMatrix(
|
test_dmatrix: DaskDMatrix = await DaskDMatrix( # type: ignore
|
||||||
self.client,
|
self.client,
|
||||||
data=data,
|
data=data,
|
||||||
base_margin=base_margin,
|
base_margin=base_margin,
|
||||||
@@ -1675,7 +1675,7 @@ class DaskScikitLearnBase(XGBModel):
|
|||||||
iteration_range: Optional[IterationRange] = None,
|
iteration_range: Optional[IterationRange] = None,
|
||||||
) -> Any:
|
) -> Any:
|
||||||
iteration_range = self._get_iteration_range(iteration_range)
|
iteration_range = self._get_iteration_range(iteration_range)
|
||||||
test_dmatrix = await DaskDMatrix(
|
test_dmatrix: DaskDMatrix = await DaskDMatrix( # type: ignore
|
||||||
self.client,
|
self.client,
|
||||||
data=X,
|
data=X,
|
||||||
missing=self.missing,
|
missing=self.missing,
|
||||||
|
|||||||
@@ -6,8 +6,7 @@ dependencies:
|
|||||||
- pylint
|
- pylint
|
||||||
- wheel
|
- wheel
|
||||||
- setuptools
|
- setuptools
|
||||||
# https://github.com/python/mypy/issues/17617
|
- mypy
|
||||||
- mypy !=1.11.0,!=1.11.1
|
|
||||||
- numpy
|
- numpy
|
||||||
- scipy
|
- scipy
|
||||||
- pandas
|
- pandas
|
||||||
|
|||||||
@@ -647,10 +647,10 @@ async def run_from_dask_array_asyncio(scheduler_address: str) -> dxgb.TrainRetur
|
|||||||
import cupy as cp
|
import cupy as cp
|
||||||
|
|
||||||
X, y, _ = generate_array()
|
X, y, _ = generate_array()
|
||||||
X = X.map_blocks(cp.array) # type: ignore
|
X = X.to_backend("cupy")
|
||||||
y = y.map_blocks(cp.array) # type: ignore
|
y = y.to_backend("cupy")
|
||||||
|
|
||||||
m = await xgb.dask.DaskQuantileDMatrix(client, X, y)
|
m: xgb.dask.DaskDMatrix = await xgb.dask.DaskQuantileDMatrix(client, X, y) # type: ignore
|
||||||
output = await xgb.dask.train(
|
output = await xgb.dask.train(
|
||||||
client, {"tree_method": "hist", "device": "cuda"}, dtrain=m
|
client, {"tree_method": "hist", "device": "cuda"}, dtrain=m
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user