[python-package] Suppress confusing warning in dask module#6987
Open
wohoef wants to merge 2 commits intomicrosoft:masterfrom
Open
[python-package] Suppress confusing warning in dask module#6987wohoef wants to merge 2 commits intomicrosoft:masterfrom
wohoef wants to merge 2 commits intomicrosoft:masterfrom
Conversation
This commit prevents `UserWarning: Parameter n_jobs will be ignored.` from being emitted each time a model is trained with the `lightgbm.dask` estimators. The warning is now only shown if a user provides a specific, non-default value (neither None nor -1). Fixes microsoft#6797
jameslamb
requested changes
Jul 30, 2025
Collaborator
jameslamb
left a comment
There was a problem hiding this comment.
Thanks for working on this! I support this change.
Please see one suggestion I left. In addition, can you please add tests confirming that the warning is raised and everything otherwise works in these situations?
You can use this as a reference:
LightGBM/tests/python_package_test/test_dask.py
Lines 1191 to 1201 in 915c270
If you're not willing or able to add those tests, just @ me and I'd be happy to push some tests to your branch.
Co-authored-by: James Lamb <jaylamb20@gmail.com>
Author
|
Thank you for the feedback James. I'll try to see if I can work on writing some tests :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit prevents
UserWarning: Parameter n_jobs will be ignored.from being emitted each time a model is trained with thelightgbm.daskestimators.The warning is now only shown if a user provides a specific, non-default value (neither None nor -1).
Fixes #6797