Skip to content

Commit cbc392e

Browse files
authored
Merge pull request #782 from mikeroll/remove-requeue-args
redis: Remove deprecated `requeue_{deadline,interval}` arguments
2 parents 3a94a77 + 768396a commit cbc392e

File tree

3 files changed

+5
-19
lines changed

3 files changed

+5
-19
lines changed

docs/source/changelog.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,15 @@ These are changes that while technically breaking, we believe are unlikely to ef
4747
This is only relevant if you have written custom code (such as a custom Rate Limiter)
4848
that uses a ``RateLimiterBackend``.
4949
(`#741`_, `#772`_, `@mikeroll`_)
50+
* The deprecated ``requeue_deadline`` and ``requeue_interval`` arguments of |RedisBroker| have been removed.
51+
These have been deprecated and have had no effect since version 1.2.0.
52+
(`#782`_, `@mikeroll`_)
5053

5154
.. _#766: https://github.com/Bogdanp/dramatiq/pull/766
5255
.. _PEP-735: https://peps.python.org/pep-0735/
5356
.. _#741: https://github.com/Bogdanp/dramatiq/issues/741
5457
.. _#772: https://github.com/Bogdanp/dramatiq/pull/772
58+
.. _#782: https://github.com/Bogdanp/dramatiq/pull/782
5559
.. _@mikeroll: https://github.com/mikeroll
5660

5761
Fixed

dramatiq/brokers/redis.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import glob
2121
import random
2222
import time
23-
import warnings
2423
from os import path
2524
from threading import Lock
2625
from typing import Optional
@@ -82,9 +81,7 @@ class RedisBroker(Broker):
8281
offline.
8382
dead_message_ttl(int): The amount of time (in ms) that
8483
dead-lettered messages are kept in Redis for.
85-
requeue_deadline(int): Deprecated. Does nothing.
86-
requeue_interval(int): Deprecated. Does nothing.
87-
client(redis.StrictRedis): A redis client to use.
84+
client(redis.Redis): A redis client to use.
8885
**parameters: Connection parameters are passed directly
8986
to :class:`redis.Redis`.
9087
@@ -100,8 +97,6 @@ def __init__(
10097
maintenance_chance=DEFAULT_MAINTENANCE_CHANCE,
10198
heartbeat_timeout=DEFAULT_HEARTBEAT_TIMEOUT,
10299
dead_message_ttl=DEFAULT_DEAD_MESSAGE_TTL,
103-
requeue_deadline=None,
104-
requeue_interval=None,
105100
client=None,
106101
**parameters,
107102
):
@@ -110,10 +105,6 @@ def __init__(
110105
if url:
111106
parameters["connection_pool"] = redis.ConnectionPool.from_url(url)
112107

113-
if requeue_deadline or requeue_interval:
114-
message = "requeue_{deadline,interval} have been deprecated and no longer do anything"
115-
warnings.warn(message, DeprecationWarning, stacklevel=2)
116-
117108
self.broker_id = str(uuid4())
118109
self.namespace = namespace
119110
self.maintenance_chance = maintenance_chance

tests/test_redis.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -332,15 +332,6 @@ def test_redis_broker_can_connect_via_client():
332332
assert broker.client is client
333333

334334

335-
def test_redis_broker_warns_about_deprecated_parameters():
336-
# When I pass deprecated params to RedisBroker
337-
# Then it should warn me that those params do nothing
338-
with pytest.warns(DeprecationWarning) as record:
339-
RedisBroker(requeue_deadline=1000)
340-
341-
assert str(record[0].message) == "requeue_{deadline,interval} have been deprecated and no longer do anything"
342-
343-
344335
def test_redis_broker_raises_attribute_error_when_given_an_invalid_attribute(redis_broker):
345336
# Given that I have a Redis broker
346337
# When I try to access an attribute that doesn't exist

0 commit comments

Comments
 (0)