Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[python-package] Fix mypy errors for fit() incompatible signature #5679

Merged
merged 5 commits into from
Jan 31, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -1333,7 +1333,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 @@ -1486,7 +1486,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