Skip to content

Commit

Permalink
[python-package] [dask] fix mypy errors about Dask fit() return types (
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb authored Mar 3, 2023
1 parent e423120 commit 709ea4c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions python-package/lightgbm/dask.py
Original file line number Diff line number Diff line change
Expand Up @@ -1175,7 +1175,7 @@ def fit( # type: ignore[override]
**kwargs: Any
) -> "DaskLGBMClassifier":
"""Docstring is inherited from the lightgbm.LGBMClassifier.fit."""
return self._lgb_dask_fit(
self._lgb_dask_fit(
model_factory=LGBMClassifier,
X=X,
y=y,
Expand All @@ -1189,6 +1189,7 @@ def fit( # type: ignore[override]
eval_metric=eval_metric,
**kwargs
)
return self

_base_doc = _lgbmmodel_doc_fit.format(
X_shape="Dask Array or Dask DataFrame of shape = [n_samples, n_features]",
Expand Down Expand Up @@ -1378,7 +1379,7 @@ def fit( # type: ignore[override]
**kwargs: Any
) -> "DaskLGBMRegressor":
"""Docstring is inherited from the lightgbm.LGBMRegressor.fit."""
return self._lgb_dask_fit(
self._lgb_dask_fit(
model_factory=LGBMRegressor,
X=X,
y=y,
Expand All @@ -1391,6 +1392,7 @@ def fit( # type: ignore[override]
eval_metric=eval_metric,
**kwargs
)
return self

_base_doc = _lgbmmodel_doc_fit.format(
X_shape="Dask Array or Dask DataFrame of shape = [n_samples, n_features]",
Expand Down Expand Up @@ -1550,7 +1552,7 @@ def fit( # type: ignore[override]
**kwargs: Any
) -> "DaskLGBMRanker":
"""Docstring is inherited from the lightgbm.LGBMRanker.fit."""
return self._lgb_dask_fit(
self._lgb_dask_fit(
model_factory=LGBMRanker,
X=X,
y=y,
Expand All @@ -1566,6 +1568,7 @@ def fit( # type: ignore[override]
eval_at=eval_at,
**kwargs
)
return self

_base_doc = _lgbmmodel_doc_fit.format(
X_shape="Dask Array or Dask DataFrame of shape = [n_samples, n_features]",
Expand Down

0 comments on commit 709ea4c

Please sign in to comment.