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] [ci] fix mypy errors in Booster.__inner_predict() #5852

Merged
merged 2 commits into from
Apr 25, 2023

Conversation

jameslamb
Copy link
Collaborator

Contributes to #3867.

Fixes the following errors mypy:

python-package/lightgbm/basic.py:4517: error: No overload variant of "__setitem__" of "list" matches argument types "int", "ndarray[Any, dtype[floating[_64Bit]]]"  [call-overload]
python-package/lightgbm/basic.py:4517: note: Possible overload variants:
python-package/lightgbm/basic.py:4517: note:     def __setitem__(self, SupportsIndex, None, /) -> None
python-package/lightgbm/basic.py:4517: note:     def __setitem__(self, slice, Iterable[None], /) -> None
python-package/lightgbm/basic.py:4521: error: "None" has no attribute "ctypes"  [attr-defined]
python-package/lightgbm/basic.py:4527: error: Argument 1 to "len" has incompatible type "None"; expected "Sized"  [arg-type]
python-package/lightgbm/basic.py:4532: error: "None" has no attribute "size"  [attr-defined]
python-package/lightgbm/basic.py:4533: error: "None" has no attribute "reshape"  [attr-defined]
python-package/lightgbm/basic.py:4534: error: Incompatible return value type (got "Optional[Any]", expected "ndarray[Any, Any]")  [return-value]

@jameslamb jameslamb changed the title WIP: [python-package] [ci] fix mypy errors in Booster.__inner_predict() [python-package] [ci] fix mypy errors in Booster.__inner_predict() Apr 25, 2023
@jameslamb jameslamb requested a review from guolinke April 25, 2023 04:35
@jameslamb jameslamb marked this pull request as ready for review April 25, 2023 04:35
@jameslamb jameslamb merged commit 8670013 into master Apr 25, 2023
@jameslamb jameslamb deleted the ci/mypy-inner-predict branch April 25, 2023 19:34
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity since it was closed.
To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues
including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants