Skip to content

Commit 06c4246

Browse files
authored
[CI] Workaround mypy errors. (dmlc#10754)
1 parent 25966e4 commit 06c4246

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

python-package/xgboost/dask/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1634,7 +1634,7 @@ async def _predict_async(
16341634
if isinstance(predts, dd.DataFrame):
16351635
predts = predts.to_dask_array()
16361636
else:
1637-
test_dmatrix = await DaskDMatrix(
1637+
test_dmatrix: DaskDMatrix = await DaskDMatrix( # type: ignore
16381638
self.client,
16391639
data=data,
16401640
base_margin=base_margin,
@@ -1675,7 +1675,7 @@ async def _apply_async(
16751675
iteration_range: Optional[IterationRange] = None,
16761676
) -> Any:
16771677
iteration_range = self._get_iteration_range(iteration_range)
1678-
test_dmatrix = await DaskDMatrix(
1678+
test_dmatrix: DaskDMatrix = await DaskDMatrix( # type: ignore
16791679
self.client,
16801680
data=X,
16811681
missing=self.missing,

tests/ci_build/conda_env/python_lint.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ dependencies:
66
- pylint
77
- wheel
88
- setuptools
9-
# https://github.com/python/mypy/issues/17617
10-
- mypy !=1.11.0,!=1.11.1
9+
- mypy
1110
- numpy
1211
- scipy
1312
- pandas

tests/test_distributed/test_gpu_with_dask/test_gpu_with_dask.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -647,10 +647,10 @@ async def run_from_dask_array_asyncio(scheduler_address: str) -> dxgb.TrainRetur
647647
import cupy as cp
648648

649649
X, y, _ = generate_array()
650-
X = X.map_blocks(cp.array) # type: ignore
651-
y = y.map_blocks(cp.array) # type: ignore
650+
X = X.to_backend("cupy")
651+
y = y.to_backend("cupy")
652652

653-
m = await xgb.dask.DaskQuantileDMatrix(client, X, y)
653+
m: xgb.dask.DaskDMatrix = await xgb.dask.DaskQuantileDMatrix(client, X, y) # type: ignore
654654
output = await xgb.dask.train(
655655
client, {"tree_method": "hist", "device": "cuda"}, dtrain=m
656656
)

0 commit comments

Comments
 (0)