Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(redis): import redis pipeline using full path #1565

Merged
merged 2 commits into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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