Grokzen / redis-py-cluster

Python cluster client for the official redis cluster. Redis 3.0+.
https://redis-py-cluster.readthedocs.io/
MIT License
1.1k stars 315 forks source link

Export ClusterPipeline as part of rediscluster #442

Closed FranGM closed 3 years ago

FranGM commented 3 years ago

This will allow users of the library to subclass ClusterPipeline as well as RedisClient

Fixes https://github.com/Grokzen/redis-py-cluster/issues/441

Grokzen commented 3 years ago

@FranGM This looks good an easy to merge and wont harm anyone/anything.

But i am just more curious in how exactly you are patching/sublcassing this really becuase when i look inside redis-py they do not expose this class in their all method and they have no option to change out the pipeline class as a input argument to the def pipeline(...) method either.

FranGM commented 3 years ago

The short version is that we also have our own subclass of StrictRedis which overrides the pipeline method (https://github.com/reddit/baseplate.py/blob/develop/baseplate/clients/redis.py#L142-L163) but you're right, they also don't add it to __all__, which I actually didn't realise this morning when I was looking at this. Might have needed a second coffee before opening the issue 😅

Grokzen commented 3 years ago

Ha :) no worry, i will merge it once the travis-ci run is completed

Grokzen commented 3 years ago

@FranGM Thank you for this contribution