redis-py
redis-py copied to clipboard
[suggestion] support rediscluster schemes like `rediscluster://host:port/`
Version: 5.0.1
Platform: python 3.10.12 on Ubuntu 22.04.3 LTS
Description: The redis.RedisCluster works almost same as redis.Redis, So I suggest when the redis.Redis.from_url return a redis.RedisCluster instance where the url startswith rediscluster. the code looks like this
class Redis:
@classmethod
def from_url(cls, url: str, **kwargs) -> Unionr["Redis", "RedisCluster"]:
if url.startswith("rediscluster"):
return RedisCluster.from_url(url, **kwargs)
...
I found that the host and schema was parse by urllib.parse.urlparse, so I changed the schema from redis_cluster to rediscluster
I create a pr to support this schema. #3152
This issue is marked stale. It will be closed in 30 days if it is not updated.