Skip to content

Commit

Permalink
[CI] Workaround mypy errors. (#10754)
Browse files Browse the repository at this point in the history
  • Loading branch information
trivialfis authored Aug 26, 2024
1 parent 25966e4 commit 06c4246
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions python-package/xgboost/dask/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1634,7 +1634,7 @@ async def _predict_async(
if isinstance(predts, dd.DataFrame):
predts = predts.to_dask_array()
else:
test_dmatrix = await DaskDMatrix(
test_dmatrix: DaskDMatrix = await DaskDMatrix( # type: ignore
self.client,
data=data,
base_margin=base_margin,
Expand Down Expand Up @@ -1675,7 +1675,7 @@ async def _apply_async(
iteration_range: Optional[IterationRange] = None,
) -> Any:
iteration_range = self._get_iteration_range(iteration_range)
test_dmatrix = await DaskDMatrix(
test_dmatrix: DaskDMatrix = await DaskDMatrix( # type: ignore
self.client,
data=X,
missing=self.missing,
Expand Down
3 changes: 1 addition & 2 deletions tests/ci_build/conda_env/python_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ dependencies:
- pylint
- wheel
- setuptools
# https://github.com/python/mypy/issues/17617
- mypy !=1.11.0,!=1.11.1
- mypy
- numpy
- scipy
- pandas
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -647,10 +647,10 @@ async def run_from_dask_array_asyncio(scheduler_address: str) -> dxgb.TrainRetur
import cupy as cp

X, y, _ = generate_array()
X = X.map_blocks(cp.array) # type: ignore
y = y.map_blocks(cp.array) # type: ignore
X = X.to_backend("cupy")
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(
client, {"tree_method": "hist", "device": "cuda"}, dtrain=m
)
Expand Down

0 comments on commit 06c4246

Please sign in to comment.