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

[suggestion] support rediscluster schemes like rediscluster://host:port/ #3136

Open
ramwin opened this issue Feb 8, 2024 · 2 comments
Open

Comments

@ramwin
Copy link

ramwin commented Feb 8, 2024

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)
        ...
@ramwin
Copy link
Author

ramwin commented Feb 8, 2024

I found that the host and schema was parse by urllib.parse.urlparse, so I changed the schema from redis_cluster to rediscluster

@ramwin ramwin changed the title [suggestion] support redis_cluster schemes like redis_cluster://host:port/ [suggestion] support redis_cluster schemes like rediscluster://host:port/ Feb 8, 2024
@ramwin ramwin changed the title [suggestion] support redis_cluster schemes like rediscluster://host:port/ [suggestion] support rediscluster schemes like rediscluster://host:port/ Feb 8, 2024
@ramwin
Copy link
Author

ramwin commented Feb 20, 2024

I create a pr to support this schema. #3152

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant