From efe267de7efb35bdc5c1167c7fae63253e3b6a5e Mon Sep 17 00:00:00 2001 From: crusaderky Date: Thu, 30 Apr 2026 00:18:02 +0100 Subject: [PATCH 1/2] Clean up deprecated Lock client parameter --- distributed/lock.py | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/distributed/lock.py b/distributed/lock.py index 5e10a228a2c..1ae0f00f156 100644 --- a/distributed/lock.py +++ b/distributed/lock.py @@ -36,9 +36,6 @@ class Lock(Semaphore): Name of the lock to acquire. Choosing the same name allows two disconnected processes to coordinate a lock. If not given, a random name will be generated. - client: Client (optional) - Client to use for communication with the scheduler. If not given, the - default global client will be used. Examples -------- @@ -48,22 +45,7 @@ class Lock(Semaphore): >>> lock.release() # doctest: +SKIP """ - def __init__( - self, - name=None, - client=_no_value, - scheduler_rpc=None, - loop=None, - ): - if client is not _no_value: - import warnings - - warnings.warn( - "The `client` parameter is deprecated. It is no longer necessary to pass a client to Lock.", - DeprecationWarning, - stacklevel=2, - ) - + def __init__(self, name=None, scheduler_rpc=None, loop=None): self.name = name or "lock-" + uuid.uuid4().hex super().__init__( max_leases=1, From e4ea3309cfa7fb44185ec1ab4f75858aeda1a795 Mon Sep 17 00:00:00 2001 From: crusaderky Date: Fri, 1 May 2026 17:40:40 +0100 Subject: [PATCH 2/2] Fix merge conflict --- distributed/lock.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/distributed/lock.py b/distributed/lock.py index d27fc9d12ac..28caac073e6 100644 --- a/distributed/lock.py +++ b/distributed/lock.py @@ -47,6 +47,12 @@ class Lock(Semaphore): def __init__(self, name=None, scheduler_rpc=None, loop=None): self.name = name or f"lock-{uuid.uuid4().hex}" + super().__init__( + max_leases=1, + name=name, + scheduler_rpc=scheduler_rpc, + loop=loop, + ) def acquire(self, blocking=True, timeout=None): """Acquire the lock