[python-package][dask] avoid warning for default n_jobs values#7195
Open
[python-package][dask] avoid warning for default n_jobs values#7195
Conversation
jameslamb
requested changes
Mar 13, 2026
Member
jameslamb
left a comment
There was a problem hiding this comment.
There is already an open PR attempting to close this, authored by (as far as I can tell) a human who put effort into it: #6987
I'd prefer to take that PR over this LLM-generated one.
It has been 8 months since they last interacted there though. I just asked them to respond. If we don't hear back soon, I'd be ok with closing that PR and pursuing this one. If we do that, please do see my notes about the tests.
|
|
||
|
|
||
| @pytest.mark.parametrize("n_jobs", [-1, None]) | ||
| def test_does_not_warn_on_default_n_jobs_alias_values(cluster, n_jobs): |
Member
There was a problem hiding this comment.
This does not test the behavior described in #6797
- doesn't actually check the log output to confirm a warning isn't raised
- passes parameter
n_jobswhich is interesting, but the issue says the warning is raised even when not passing any multithreading related parameters
If we move forward with this PR, this needs to be updated to confirm that the issue is actually fixed.
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.
Summary
lightgbm.dask._train()when anum_threadsalias is present with default sklearn-constructor values (Noneor-1)num_threads/num_machinesvalues that are ignoredn_jobsalias values (-1,None)Testing
python -m compileall -q python-package/lightgbm/dask.py tests/python_package_test/test_dask.pytest_dask.pyrun could not be executed here because the available LightGBM test environment lacksdask/distributedand package install is blocked by network proxyFixes #6797