diff --git a/sentry_sdk/integrations/redis.py b/sentry_sdk/integrations/redis.py index fc4e9cc7c2..c27eefa3f6 100644 --- a/sentry_sdk/integrations/redis.py +++ b/sentry_sdk/integrations/redis.py @@ -82,10 +82,10 @@ def _patch_rediscluster(): # StrictRedisCluster was introduced in v0.2.0 and removed in v2.0.0 # https://github.com/Grokzen/redis-py-cluster/blob/master/docs/release-notes.rst if (0, 2, 0) < version < (2, 0, 0): - pipeline_cls = rediscluster.StrictClusterPipeline + pipeline_cls = rediscluster.pipeline.StrictClusterPipeline patch_redis_client(rediscluster.StrictRedisCluster, is_cluster=True) else: - pipeline_cls = rediscluster.ClusterPipeline + pipeline_cls = rediscluster.pipeline.ClusterPipeline patch_redis_pipeline(pipeline_cls, True, _parse_rediscluster_command) diff --git a/tests/integrations/rediscluster/test_rediscluster.py b/tests/integrations/rediscluster/test_rediscluster.py index 9be21a2953..62923cffae 100644 --- a/tests/integrations/rediscluster/test_rediscluster.py +++ b/tests/integrations/rediscluster/test_rediscluster.py @@ -15,7 +15,7 @@ def monkeypatch_rediscluster_classes(reset_integrations): try: - pipeline_cls = rediscluster.ClusterPipeline + pipeline_cls = rediscluster.pipeline.ClusterPipeline except AttributeError: pipeline_cls = rediscluster.StrictClusterPipeline rediscluster.RedisCluster.pipeline = lambda *_, **__: pipeline_cls( diff --git a/tox.ini b/tox.ini index 3eec4a7a11..cf7c1a4cfe 100644 --- a/tox.ini +++ b/tox.ini @@ -77,7 +77,7 @@ envlist = {py2.7,py3.8,py3.9}-requests {py2.7,py3.7,py3.8,py3.9}-redis - {py2.7,py3.7,py3.8,py3.9}-rediscluster-{1,2} + {py2.7,py3.7,py3.8,py3.9}-rediscluster-{1,2.1.0,2} {py2.7,py3.7,py3.8,py3.9,py3.10}-sqlalchemy-{1.2,1.3} @@ -227,7 +227,8 @@ deps = redis: fakeredis<1.7.4 rediscluster-1: redis-py-cluster>=1.0.0,<2.0.0 - rediscluster-2: redis-py-cluster>=2.0.0,<3.0.0 + rediscluster-2.1.0: redis-py-cluster>=2.0.0,<2.1.1 + rediscluster-2: redis-py-cluster>=2.1.1,<3.0.0 sqlalchemy-1.2: sqlalchemy>=1.2,<1.3 sqlalchemy-1.3: sqlalchemy>=1.3,<1.4