Skip to content

[python-package] add a few type hints in LGBMModel.fit()#6470

Merged
jameslamb merged 4 commits intomasterfrom
mypy/sklearn-get-metadata
Jun 5, 2024
Merged

[python-package] add a few type hints in LGBMModel.fit()#6470
jameslamb merged 4 commits intomasterfrom
mypy/sklearn-get-metadata

Conversation

@jameslamb
Copy link
Collaborator

Contributes to #3867
Contributes to #3756

Pulls a function re-defined on every call to LGBMModel.fit() up to the module level, and adds type hints, a docstring, and comments to make it easier to understand and to improve mypy's ability to catch bugs on codepaths that go through it.

Resolves this error from mypy:

python-package/lightgbm/sklearn.py:872: error: Function is missing a type annotation  [no-untyped-def]

@jameslamb jameslamb requested a review from borchero June 3, 2024 03:18
@jameslamb jameslamb merged commit 4401401 into master Jun 5, 2024
@jameslamb jameslamb deleted the mypy/sklearn-get-metadata branch June 5, 2024 12:54
@github-actions
Copy link
Contributor

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 Jul 10, 2025
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