-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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 eval_at and basic #5674
[python-package] fix mypy errors for eval_at and basic #5674
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again for working on this! I left one question for your consideration.
python-package/lightgbm/dask.py
Outdated
@@ -407,7 +407,7 @@ def _train( | |||
eval_init_score: Optional[List[_DaskCollection]] = None, | |||
eval_group: Optional[List[_DaskVectorLike]] = None, | |||
eval_metric: Optional[_LGBM_ScikitEvalMetricType] = None, | |||
eval_at: Optional[Union[List[int], Tuple[int]]] = None, | |||
eval_at: Union[List[int], Tuple[int, ...], None] = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is Union[something, something_else, None]
preferable to Optional[Union[something, something_else]]
? If that's just a personal style preference thing, please revert that part of this change. I personally prefer the Optional[]
form.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, no problem, changed it to Optional[] form.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much, changes look great to me! I just merged latest master
into this, will merge this once CI passes.
This pull request has been automatically locked since there has not been any recent activity since it was closed. |
Contributes to #3867.
Moved from #5672.
Fixes
mypy
errors regardingeval_at
incompatibility:and the following two errors:
Notes for Reviewers
This was tested by running mypy as documented in #3867.