Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions distributed/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1237,20 +1237,6 @@ def __init__(

ReplayTaskClient(self)

@property
def io_loop(self) -> IOLoop | None:
warnings.warn(
"The io_loop property is deprecated", DeprecationWarning, stacklevel=2
)
return self.loop

@io_loop.setter
def io_loop(self, value: IOLoop) -> None:
warnings.warn(
"The io_loop property is deprecated", DeprecationWarning, stacklevel=2
)
self.loop = value

@property
def loop(self) -> IOLoop | None:
loop = self.__loop
Expand All @@ -1262,13 +1248,6 @@ def loop(self) -> IOLoop | None:
self.__loop = loop = self._loop_runner.loop
return loop

@loop.setter
def loop(self, value: IOLoop) -> None:
warnings.warn(
"setting the loop property is deprecated", DeprecationWarning, stacklevel=2
)
self.__loop = value

@contextmanager
def as_current(self):
"""Thread-local, Task-local context manager that causes the Client.current
Expand Down
8 changes: 0 additions & 8 deletions distributed/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ def __init__(
deserializers=None,
connection_args=None,
timeout=None,
io_loop=None,
local_directory=None,
needs_workdir=True,
):
Expand Down Expand Up @@ -274,13 +273,6 @@ def __init__(
sys.path.insert(0, self.local_directory)
self._updated_sys_path = True

if io_loop is not None:
warnings.warn(
"The io_loop kwarg to Server is ignored and will be deprecated",
DeprecationWarning,
stacklevel=2,
)

self._status = Status.init
self.handlers = {
"identity": self.identity,
Expand Down
9 changes: 0 additions & 9 deletions distributed/deploy/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,6 @@ def loop(self) -> IOLoop | None:
self.__loop = loop = self._loop_runner.loop
return loop

@loop.setter
def loop(self, value: IOLoop) -> None:
warnings.warn(
"setting the loop property is deprecated", DeprecationWarning, stacklevel=2
)
if value is None:
raise ValueError("expected an IOLoop, got None")
self.__loop = value

@property
def called_from_running_loop(self):
try:
Expand Down
17 changes: 0 additions & 17 deletions distributed/deploy/tests/test_cluster.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import annotations

import pytest
from tornado.ioloop import IOLoop

from distributed import LocalCluster, Status
from distributed.deploy.cluster import Cluster, _exponential_backoff
Expand Down Expand Up @@ -51,22 +50,6 @@ async def test_cluster_wait_for_worker():
assert len(cluster.scheduler.workers) == 4


@gen_test()
async def test_deprecated_loop_properties():
class ExampleCluster(Cluster):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.loop = self.io_loop = IOLoop.current()

with pytest.warns(DeprecationWarning) as warninfo:
async with ExampleCluster(asynchronous=True, loop=IOLoop.current()):
pass

assert [(w.category, *w.message.args) for w in warninfo] == [
(DeprecationWarning, "setting the loop property is deprecated")
]


def test_exponential_backoff():
assert _exponential_backoff(0, 1.5, 3, 20) == 1.5
assert _exponential_backoff(1, 1.5, 3, 20) == 4.5
Expand Down
7 changes: 0 additions & 7 deletions distributed/diagnostics/progressbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,6 @@ def loop(self) -> IOLoop | None:
self.__loop = loop = self._loop_runner.loop
return loop

@loop.setter
def loop(self, value: IOLoop) -> None:
warnings.warn(
"setting the loop property is deprecated", DeprecationWarning, stacklevel=2
)
self.__loop = value

def _draw_bar(self, remaining, all, **kwargs):
frac = (1 - remaining / all) if all else 1.0
bar = "#" * int(self.width * frac)
Expand Down
16 changes: 0 additions & 16 deletions distributed/diagnostics/tests/test_progressbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from time import sleep

import pytest
from tornado.ioloop import IOLoop

from distributed.diagnostics.progressbar import TextProgressBar, progress
from distributed.metrics import time
Expand Down Expand Up @@ -85,18 +84,3 @@ def test_progress_function_warns(client):
def test_progress_function_raises():
with pytest.raises(ValueError, match="`group_by` should be "):
progress(None, group_by="incorrect")


@gen_cluster(client=True, nthreads=[])
async def test_deprecated_loop_properties(c, s):
class ExampleTextProgressBar(TextProgressBar):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.loop = self.io_loop = IOLoop.current()

with pytest.warns(DeprecationWarning) as warninfo:
ExampleTextProgressBar(client=c, keys=[], start=False, loop=IOLoop.current())

assert [(w.category, *w.message.args) for w in warninfo] == [
(DeprecationWarning, "setting the loop property is deprecated")
]
9 changes: 0 additions & 9 deletions distributed/nanny.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ def __init__( # type: ignore[no-untyped-def]
scheduler_file=None,
worker_port: int | str | Collection[int] | None = 0,
nthreads=None,
loop=None,
local_directory=None,
services=None,
name=None,
Expand All @@ -154,14 +153,6 @@ def __init__( # type: ignore[no-untyped-def]
config=None,
**worker_kwargs,
):
if loop is not None:
warnings.warn(
"the `loop` kwarg to `Nanny` is ignored, and will be removed in a future release. "
"The Nanny always binds to the current loop.",
DeprecationWarning,
stacklevel=2,
)

self.__exit_stack = stack = contextlib.ExitStack()
self.process = None
self._setup_logging(logger)
Expand Down
8 changes: 1 addition & 7 deletions distributed/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -3924,7 +3924,7 @@ class Scheduler(SchedulerState, ServerNode):

def __init__(
self,
loop: IOLoop | None = None,
*,
services: dict | None = None,
service_kwargs: dict | None = None,
allowed_failures: int | None = None,
Expand Down Expand Up @@ -3953,12 +3953,6 @@ def __init__(
raise RuntimeError(
"Pickling can no longer be disabled with the `distributed.scheduler.pickle` option. Please remove this configuration to start the scheduler."
)
if loop is not None:
warnings.warn(
"the loop kwarg to Scheduler is deprecated",
DeprecationWarning,
stacklevel=2,
)

self.loop = self.io_loop = IOLoop.current()
self._setup_logging(logger)
Expand Down
19 changes: 0 additions & 19 deletions distributed/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import yaml
from packaging.version import parse as parse_version
from tlz import concat, first, identity, isdistinct, merge, pluck, valmap
from tornado.ioloop import IOLoop

import dask
import dask.bag as db
Expand Down Expand Up @@ -8024,24 +8023,6 @@ def test_quiet_close_process(processes, tmp_path):
assert not lines


@gen_cluster(client=False, nthreads=[])
async def test_deprecated_loop_properties(s):
class ExampleClient(Client):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.loop = self.io_loop = IOLoop.current()

with pytest.warns(DeprecationWarning) as warninfo:
async with ExampleClient(s.address, asynchronous=True, loop=IOLoop.current()):
pass

assert [(w.category, *w.message.args) for w in warninfo] == [
(DeprecationWarning, "setting the loop property is deprecated"),
(DeprecationWarning, "The io_loop property is deprecated"),
(DeprecationWarning, "setting the loop property is deprecated"),
]


@gen_cluster(client=False, nthreads=[])
async def test_fast_close_on_aexit_failure(s):
class MyException(Exception):
Expand Down
10 changes: 0 additions & 10 deletions distributed/tests/test_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import psutil
import pytest
from tlz import concat, first, merge
from tornado.ioloop import IOLoop

import dask
from dask import bag, delayed
Expand Down Expand Up @@ -1450,15 +1449,6 @@ async def test_update_graph_culls(s, a, b):
assert "z" not in s.tasks


@gen_test()
async def test_io_loop(loop):
with pytest.warns(
DeprecationWarning, match=r"the loop kwarg to Scheduler is deprecated"
):
s = Scheduler(loop=loop, dashboard_address=":0", validate=True)
assert s.io_loop is IOLoop.current()


@gen_cluster(client=True)
async def test_story(c, s, a, b):
x = delayed(inc)(1)
Expand Down
12 changes: 0 additions & 12 deletions distributed/tests/test_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import psutil
import pytest
from tlz import first, pluck, sliding_window
from tornado.ioloop import IOLoop

import dask
from dask import delayed
Expand Down Expand Up @@ -592,17 +591,6 @@ async def test_io_loop(s):
assert w.io_loop is w.loop is s.loop


@gen_cluster(nthreads=[])
async def test_io_loop_alternate_loop(s, loop):
with pytest.warns(
DeprecationWarning,
match=r"The `loop` argument to `Worker` is ignored, and will be "
r"removed in a future release. The Worker always binds to the current loop",
):
async with Worker(s.address, loop=loop) as w:
assert w.io_loop is w.loop is IOLoop.current()


@gen_cluster(client=True)
async def test_access_key(c, s, a, b):
def f(i):
Expand Down
9 changes: 1 addition & 8 deletions distributed/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,6 @@ def __init__(
*,
scheduler_file: str | None = None,
nthreads: int | None = None,
loop: IOLoop | None = None, # Deprecated
local_directory: str | None = None,
services: dict | None = None,
name: Any | None = None,
Expand Down Expand Up @@ -558,13 +557,7 @@ def __init__(
DeprecationWarning,
stacklevel=2,
)
if loop is not None:
warnings.warn(
"The `loop` argument to `Worker` is ignored, and will be removed in a future release. "
"The Worker always binds to the current loop",
DeprecationWarning,
stacklevel=2,
)

self.__exit_stack = stack = contextlib.ExitStack()
self.nanny = nanny
self._lock = threading.Lock()
Expand Down
Loading