Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

zrevrangebyscore in aioredis in different than in redis #1393

Open
1 task done
91DarioDev opened this issue Jul 16, 2022 · 2 comments
Open
1 task done

zrevrangebyscore in aioredis in different than in redis #1393

91DarioDev opened this issue Jul 16, 2022 · 2 comments
Labels

Comments

@91DarioDev
Copy link

Describe the bug

I had my code running with redis-py in the version sync.
I added asycn/await everywhere and replaced the import of redis with aioredis.

zrevrangebyscore after that started returning no results, empty list, despite with redis-py sync it was returning values correctly!

now my code was with async/await so I tried to use

from redis import asyncio as aioredis

And magically zrevrangebyscore is returning results as expected again.

So I think there is some difference between the version implemented in redis-py and aioredis. What is the difference?

Anyways I fixed using redis-py in his async version.

aioredis version 2.0.1
redis-py version 4.3.4

To Reproduce

use zrevrangebyscore in aioredis and redis

Expected behavior

working the same way between aioredis and redis-py

Logs/tracebacks

no errors just empty list

Python Version

$ python --version
3.10

aioredis Version

$ python -m pip show aioredis
2.0.1

Additional context

No response

Code of Conduct

  • I agree to follow the aio-libs Code of Conduct
@91DarioDev 91DarioDev added the bug label Jul 16, 2022
@boh5
Copy link

boh5 commented Jul 28, 2022

Same problem, this bug has not been fixed until version 2.0.1

@boh5
Copy link

boh5 commented Jul 28, 2022

According to README, aioredis is now in redis-py 4.2.0rc1+. So you should use redis instead of aioredis.

from redis import asyncio as aioredis

But there seems to be a bug in pycharm, it warns that Cannot find reference 'asyncio' in '__init__.pyi'

Update: fix pycharm import warning
According to redis-py issues

you can install types-redis it solves the problem

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

No branches or pull requests

2 participants