-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Pylance type checking issues with async redis.hset #3169
New issue
Have a question about this project? No Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “No 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? No Sign in to your account
Comments
I have the exact same issue. The async client is not typed and instead relies on the core commands, for example hset defined here: redis-py/redis/commands/core.py Lines 5000 to 5007 in 9df2225
Notice the redis-py/redis/commands/core.py Line 5087 in 9df2225
Now pyright (and pylance) complain because it still thinks that either of the two options is a possibility, when it actually isn't. The solution would be to define the actual I've decided to live with it and simply Edit: Alternatively, you can use if inspect.isawaitable(rset := self._redis.set(key, data)):
await rset |
Related issue here (but non async): #2399 |
This issue is marked stale. It will be closed in 30 days if it is not updated. |
This issue is not stale and it's super annoying? |
same |
Interested in this as well, along with #3574. The PR above looks interesting!!! |
Version: What redis-py and what redis version is the issue happening on?
5.0.2
Platform: What platform / version? (For example Python 3.5.1 on Windows 7 / Ubuntu 15.10 / Azure)
3.12
Description: Description of your issue, stack traces from errors and code that reproduces the issue
Pylance throws a type checking issue while trying to use await with hset using a redis.asyncio.client.Redis instance
Is this working as intended?
The text was updated successfully, but these errors were encountered: