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

sort() on sorted sets fails with numeric ordering #153

Open
tetrapus opened this issue Oct 3, 2018 · 0 comments
Open

sort() on sorted sets fails with numeric ordering #153

tetrapus opened this issue Oct 3, 2018 · 0 comments

Comments

@tetrapus
Copy link

tetrapus commented Oct 3, 2018

Tested on Python 3.6, against redis 4.0.11

>>> def test_sort(redis):
  2     redis.zadd('testing', '100', 1)
  3     redis.zadd('testing', '200', 0)
  4     return redis.sort('testing', desc=True)
>>> from redis import Redis
>>> test_sort(Redis())
[b'200', b'100']
>>> from mockredis import MockRedis
>>> test_sort(MockRedis())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 4, in test_sort
  File "<redacted>/.venv/lib/python3.6/site-packages/mockredis/client.py", line 822, in sort
    items.sort(key=lambda x: sort_type(x[1]), reverse=bool(desc))
  File "<redacted>/.venv/lib/python3.6/site-packages/mockredis/client.py", line 822, in <lambda>
    items.sort(key=lambda x: sort_type(x[1]), reverse=bool(desc))
TypeError: float() argument must be a string or a number, not 'tuple'
float() argument must be a string or a number, not 'tuple'
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