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

Breaking changes in Redis-Py 3+ #61

Open
airman00 opened this issue Feb 15, 2019 · 1 comment · May be fixed by #62
Open

Breaking changes in Redis-Py 3+ #61

airman00 opened this issue Feb 15, 2019 · 1 comment · May be fixed by #62

Comments

@airman00
Copy link

If you install the latest version of Redis Python Client (3.1.0 at this time) you will receive this error when trying to run the sample code and use the rank_member function for the first time:
AttributeError: 'str' object has no attribute 'items'

This is because of breaking changes that occurred between Redis Client v2.x to v3.x
https://github.com/andymccurdy/redis-py#upgrading-from-redis-py-2x-to-30

This specific issue can be solved as follows, but I'm not sure if other parts may have broken:
https://stackoverflow.com/questions/53553009/not-able-to-insert-data-using-zaddsorted-set-in-redis-using-python

As a super quick fix, you can use redis python client v2.10.6

To install that version of redis run the following:
pip install redis==2.10.6

YuriHeupa added a commit to YuriHeupa/leaderboard-python that referenced this issue Mar 14, 2019
Change ZADD calls to supply keys and values as a dict instead of positional arguments.

Update tests to provide member data as string instead of dict, since redis-py 3+ only accepts data as bytes, strings or numbers.

Fixes agoragames#61
@YuriHeupa YuriHeupa linked a pull request Mar 14, 2019 that will close this issue
@YuriHeupa
Copy link

YuriHeupa commented Mar 14, 2019

I sent a PR #62 that adds support for redis-py 3+, it's pending review, but for those who need to use this lib with redis-py 3+ immediately, here's a workaround:

$ pip install git+git://github.com/YuriHeupa/leaderboard-python.git@ccf3b284db35512950909aed8d1d3436557d3efb 

This command installs the changes from my fork I used to create the PR, which supports the newest version of redis-py.

YuriHeupa added a commit to YuriHeupa/leaderboard-python that referenced this issue Jan 12, 2021
Change ZADD calls to supply keys and values as a dict instead of positional arguments.

Update tests to provide member data as string instead of dict, since redis-py 3+ only accepts data as bytes, strings or numbers.

Fixes agoragames#61
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

Successfully merging a pull request may close this issue.

2 participants