From fdc9d04dfefcf7e3a6780df0961d755cebd6a455 Mon Sep 17 00:00:00 2001 From: Oleksandr Kylymnychenko Date: Mon, 15 Aug 2022 12:35:07 +0200 Subject: [PATCH 1/2] fix(redis): import redis pipeline using full path --- sentry_sdk/integrations/redis.py | 4 ++-- tests/integrations/rediscluster/test_rediscluster.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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( From c3b90ab37a6be97fbbebbb9dca3d2b34f9bf80b9 Mon Sep 17 00:00:00 2001 From: Neel Shah Date: Tue, 16 Aug 2022 11:42:51 +0200 Subject: [PATCH 2/2] Capture rediscluster breakage in tox matrix --- tox.ini | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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