Skip to content

Commit

Permalink
[python-package] Fix mypy errors for fit() incompatible signature (#5679
Browse files Browse the repository at this point in the history
)
  • Loading branch information
IdoKendo authored Jan 31, 2023
1 parent 9954bc4 commit ed0a7f2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions python-package/lightgbm/dask.py
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@ def __init__(
def __getstate__(self) -> Dict[Any, Any]:
return self._lgb_dask_getstate()

def fit(
def fit( # type: ignore[override]
self,
X: _DaskMatrixLike,
y: _DaskCollection,
Expand Down Expand Up @@ -1349,7 +1349,7 @@ def __init__(
def __getstate__(self) -> Dict[Any, Any]:
return self._lgb_dask_getstate()

def fit(
def fit( # type: ignore[override]
self,
X: _DaskMatrixLike,
y: _DaskCollection,
Expand Down Expand Up @@ -1518,7 +1518,7 @@ def __init__(
def __getstate__(self) -> Dict[Any, Any]:
return self._lgb_dask_getstate()

def fit(
def fit( # type: ignore[override]
self,
X: _DaskMatrixLike,
y: _DaskCollection,
Expand Down
6 changes: 3 additions & 3 deletions python-package/lightgbm/sklearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ def feature_name_(self):
class LGBMRegressor(_LGBMRegressorBase, LGBMModel):
"""LightGBM regressor."""

def fit(
def fit( # type: ignore[override]
self,
X,
y,
Expand Down Expand Up @@ -1030,7 +1030,7 @@ def fit(
class LGBMClassifier(_LGBMClassifierBase, LGBMModel):
"""LightGBM classifier."""

def fit(
def fit( # type: ignore[override]
self,
X,
y,
Expand Down Expand Up @@ -1191,7 +1191,7 @@ class LGBMRanker(LGBMModel):
Please use this class mainly for training and applying ranking models in common sklearnish way.
"""

def fit(
def fit( # type: ignore[override]
self,
X,
y,
Expand Down

0 comments on commit ed0a7f2

Please sign in to comment.