-
Notifications
You must be signed in to change notification settings - Fork 94
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
Fix useless property #944
Fix useless property #944
Conversation
This class attribute is only ever looked at in __init__, so no need to save it.
The construction of nannies requires that the data argument be a callable, fix that in the case where we're trying to build a bare dictionary.
Codecov Report
@@ Coverage Diff @@
## branch-22.08 #944 +/- ##
==============================================
Coverage ? 0.00%
==============================================
Files ? 16
Lines ? 2103
Branches ? 0
==============================================
Hits ? 0
Misses ? 2103
Partials ? 0 Continue to review full report at Codecov.
|
@@ -171,7 +171,7 @@ def del_pid_file(): | |||
if jit_unspill is None: | |||
jit_unspill = dask.config.get("jit-unspill", default=False) | |||
if device_memory_limit is None and memory_limit is None: | |||
data = {} | |||
data = lambda _: {} |
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.
This breakage was not spotted by the test suite
TODO:
- introduce test that exercises this code path.
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.
Good catch!
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.
Maybe data = dict
here would make more sense? A lambda to return an empty dict looks a bit weird.
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.
data
is later called with a single argument which should be ignored in the dict case, so I don't think data = dict will work.
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.
Ah ok, I overlooked the argument. Let's leave it like this then.
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.
LGTM, thanks @wence-.
TODO: introduce test that exercises this code path
Agree, it would a good with a small test of this.
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.
Looks good @wence- , left one suggestion but otherwise should be good to go.
@@ -171,7 +171,7 @@ def del_pid_file(): | |||
if jit_unspill is None: | |||
jit_unspill = dask.config.get("jit-unspill", default=False) | |||
if device_memory_limit is None and memory_limit is None: | |||
data = {} | |||
data = lambda _: {} |
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.
Maybe data = dict
here would make more sense? A lambda to return an empty dict looks a bit weird.
@gpucibot merge |
This introduces a test that was a TODO in #944 Authors: - Lawrence Mitchell (https://github.com/wence-) Approvers: - Peter Andreas Entschev (https://github.com/pentschev) URL: #946
Make the
jit_unspill
property a local as discussed in #944.In addition, fix a bug that was introduced in
dask-cuda-worker
in #944: thedata
argument has to be a callable, and should presumably return an object that is unique for each nanny.