-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Unable to instantiate RedisCluster according to pyright #3574
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
Comments
@trajano Hi! Which version of client are you using? Could you please double check that class that you're instantiating is a correct one:
|
I'm using the asyncio one from redis.asyncio import Redis |
Which client version are you using? |
The pyproject.yaml says "redis>=5.2.1", https://pypi.org/project/redis/ from redis.asyncio import Redis It's not marked as abstract but pyright deemed it to be abstract because it is missing the implementation of "CommandsProtocol.connection_pool" is not implemented (reportAbstractUsage) |
@trajano Yeah, I totally understand from the exception message. |
I just added a ticket on pyright, but not sure what the rules are for abstract classes in Python, it's not as strict as in Java. |
According to microsoft/pyright#10225 seems like it's an issue with this library. |
@trajano Maybe, but if we would have an issue with instantiating RedisCluster object it would be catched by our tests. That's why I'm asking additional information to understand how to reproduce this issue. Anything about your environment would be appreciated |
@vladvildanov I don't have any issues of instantiating it at run time. This is primarily a type validation issue which is done on pyright (and according to microsoft/pyright#10225 (comment) it also applies to MyPy as well. The workaround I am doing is to "ignore" the type error. |
From what I can tell to fix this you add
In asyncio/cluster.py line 393 |
Python is not my primary language, so I am not sure what kind of impact that would have. Though on a side note, it is kind of annoying that the async APIs return both normal and Awaitable when it should only return awaitables. |
I'm running into the same issue... I'll just |
I got the following error on pyright
When doing
The text was updated successfully, but these errors were encountered: