Skip to content

Commit 94f7502

Browse files
olksdrsl0thentr0py
andauthored
fix(redis): import redis pipeline using full path (#1565)
* fix(redis): import rediscluster pipeline using full path * Capture rediscluster breakage in tox matrix Co-authored-by: Neel Shah <[email protected]>
1 parent 8588dbe commit 94f7502

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

sentry_sdk/integrations/redis.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ def _patch_rediscluster():
8282
# StrictRedisCluster was introduced in v0.2.0 and removed in v2.0.0
8383
# https://github.com/Grokzen/redis-py-cluster/blob/master/docs/release-notes.rst
8484
if (0, 2, 0) < version < (2, 0, 0):
85-
pipeline_cls = rediscluster.StrictClusterPipeline
85+
pipeline_cls = rediscluster.pipeline.StrictClusterPipeline
8686
patch_redis_client(rediscluster.StrictRedisCluster, is_cluster=True)
8787
else:
88-
pipeline_cls = rediscluster.ClusterPipeline
88+
pipeline_cls = rediscluster.pipeline.ClusterPipeline
8989

9090
patch_redis_pipeline(pipeline_cls, True, _parse_rediscluster_command)
9191

tests/integrations/rediscluster/test_rediscluster.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
def monkeypatch_rediscluster_classes(reset_integrations):
1616

1717
try:
18-
pipeline_cls = rediscluster.ClusterPipeline
18+
pipeline_cls = rediscluster.pipeline.ClusterPipeline
1919
except AttributeError:
2020
pipeline_cls = rediscluster.StrictClusterPipeline
2121
rediscluster.RedisCluster.pipeline = lambda *_, **__: pipeline_cls(

tox.ini

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ envlist =
7777
{py2.7,py3.8,py3.9}-requests
7878

7979
{py2.7,py3.7,py3.8,py3.9}-redis
80-
{py2.7,py3.7,py3.8,py3.9}-rediscluster-{1,2}
80+
{py2.7,py3.7,py3.8,py3.9}-rediscluster-{1,2.1.0,2}
8181

8282
{py2.7,py3.7,py3.8,py3.9,py3.10}-sqlalchemy-{1.2,1.3}
8383

@@ -227,7 +227,8 @@ deps =
227227
redis: fakeredis<1.7.4
228228

229229
rediscluster-1: redis-py-cluster>=1.0.0,<2.0.0
230-
rediscluster-2: redis-py-cluster>=2.0.0,<3.0.0
230+
rediscluster-2.1.0: redis-py-cluster>=2.0.0,<2.1.1
231+
rediscluster-2: redis-py-cluster>=2.1.1,<3.0.0
231232

232233
sqlalchemy-1.2: sqlalchemy>=1.2,<1.3
233234
sqlalchemy-1.3: sqlalchemy>=1.3,<1.4

0 commit comments

Comments
 (0)