Skip to content

Fix AttributeError in ClusterPipeline #3634

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

Merged
merged 1 commit into from
May 5, 2025
Merged

Conversation

sentrivana
Copy link
Contributor

@sentrivana sentrivana commented May 5, 2025

Pull Request check-list

Please make sure to review and check all of these items:

  • Do tests and lints pass with this change?
  • Do the CI tests pass with this change (enable it first in your forked repo and wait for the github action build to finish)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Is there an example added to the examples folder (if applicable)?
  • Was the change added to CHANGES file?

NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.

Description of change

Hey folks, while running our test suite against the newest redis-py release (6.0.0) we ran into this:

tests/integrations/redis/cluster/test_redis_cluster.py:121: in test_rediscluster_pipeline
    pipeline = rc.pipeline()
tests/integrations/redis/cluster/test_redis_cluster.py:16: in <lambda>
    redis.RedisCluster.pipeline = lambda *_, **__: pipeline_cls(None, None)
.tox/py3.13-redis-latest/lib/python3.13/site-packages/redis/utils.py:188: in wrapper
    return func(*args, **kwargs)
.tox/py3.13-redis-latest/lib/python3.13/site-packages/redis/cluster.py:2125: in __init__
    retries=self.cluster_error_retry_attempts,
E   AttributeError: 'ClusterPipeline' object has no attribute 'cluster_error_retry_attempts'

I believe this might be a bug in redis-py since ClusterPipeline no longer has the attribute cluster_error_retry_attempts -- so this code path should probably take it from the (kw)args instead. I grepped for cluster_error_retry_attempts and it doesn't seem to be used as an attribute anywhere (e.g. in a parent class).

@petyaslavova petyaslavova added the bug Bug label May 5, 2025
@petyaslavova petyaslavova merged commit 37491a4 into redis:master May 5, 2025
37 checks passed
petyaslavova pushed a commit to Kakadus/redis-py that referenced this pull request May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants