Skip to content

Commit

Permalink
fix(redis): import redis pipeline using full path (#1565)
Browse files Browse the repository at this point in the history
* fix(redis): import rediscluster pipeline using full path
* Capture rediscluster breakage in tox matrix

Co-authored-by: Neel Shah <[email protected]>
  • Loading branch information
olksdr and sl0thentr0py authored Aug 16, 2022
1 parent 8588dbe commit 94f7502
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions sentry_sdk/integrations/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion tests/integrations/rediscluster/test_rediscluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
5 changes: 3 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 94f7502

Please sign in to comment.