-
-
Notifications
You must be signed in to change notification settings - Fork 733
Use name
argument with Scheduler.remove_plugin
calls
#5260
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
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 @douglasdavis! Looking at this build there are still a few Scheduler.remove_plugin
-related warnings:
distributed/diagnostics/tests/test_progress_stream.py::test_progress_stream
distributed/diagnostics/tests/test_scheduler_plugin.py::test_async_add_remove_worker
/home/runner/work/distributed/distributed/distributed/scheduler.py:5507: FutureWarning: Removing scheduler plugins by value is deprecated and will be disabled in a future release. Please remove scheduler plugins by name instead.
warnings.warn(
distributed/diagnostics/tests/test_progress_stream.py::test_progress_stream
/home/runner/work/distributed/distributed/distributed/scheduler.py:5525: FutureWarning: Removing scheduler plugins by value is deprecated and will be disabled in a future release. Please remove scheduler plugins by name instead.
warnings.warn(
Thanks @jrbourbeau! I think I could use your opinion on how to deal with these.
|
|
Thanks! I think (2) is good to go. for (1) I went ahead and passed the |
@@ -117,7 +117,8 @@ async def start(self, scheduler): | |||
s.add_plugin(plugin) | |||
s.add_plugin(plugin, name="another") | |||
with pytest.raises(ValueError) as excinfo: | |||
s.remove_plugin(plugin) | |||
with pytest.warns(UserWarning, match="Removing scheduler plugins by value"): |
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.
Hmm based on
distributed/distributed/scheduler.py
Lines 5507 to 5511 in dc47186
warnings.warn( | |
"Removing scheduler plugins by value is deprecated and will be disabled " | |
"in a future release. Please remove scheduler plugins by name instead.", | |
category=FutureWarning, | |
) |
I would have expected this to emit a FutureWarning
instead of a UserWarning
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.
Agreed- I just made the adjustment. I wonder why it passed before
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.
Interesting. This might be a bug in pytest
(I opened up pytest-dev/pytest#9036). If you change the order of pytest.raises
and pytest.warns
, then things behave as expected
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.
Interesting find! Just pushed a commit to swap the order.
Thanks for the updates @douglasdavis! There are some tests that have begun failing which are, seemingly, unrelated to the changes here. I'm running CI against the |
Hrm, looks like these failures are unrelated... |
Alright, merging |
28986fd
to
060ac98
Compare
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 @douglasdavis! Will merge once CI finishes
name
argument with Scheduler.remove_plugin calls (silences warnings)name
argument with Scheduler.remove_plugin
calls
Closes #xxxxblack distributed
/flake8 distributed
/isort distributed
After #5120 we added a warning about removing plugins by instance instead of by name; there are a few places
distributed
where the warning was getting triggered; this should remove those warnings.