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

Redis.from_url is not supported #3

Open
kfirco opened this issue Feb 27, 2022 · 0 comments
Open

Redis.from_url is not supported #3

kfirco opened this issue Feb 27, 2022 · 0 comments

Comments

@kfirco
Copy link

kfirco commented Feb 27, 2022

I have the following code which supposes to create a new Redis client based on the from_url class method, which is supported by redis-py

`
import retry_redis

class Redis(retry_redis.Redis):
def new(cls, *args, **kwargs):
redis_client = retry_redis.Redis.from_url('http://my-url' )
return redis_client
`

When running, I receive the following error:
AttributeError: type object 'Redis' has no attribute 'from_url'

The code is working when I'm inheriting from redis-py Redis class.
The problem is probably with the 'getattr' method which only works for non-class methods

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