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

Correct order of Redis zadd dict elements #953

Merged
merged 1 commit into from
Nov 20, 2018
Merged

Correct order of Redis zadd dict elements #953

merged 1 commit into from
Nov 20, 2018

Conversation

Tenzer
Copy link
Contributor

@Tenzer Tenzer commented Nov 20, 2018

The changed zadd() behaviour in redis-py 3 states:
https://github.com/andymccurdy/redis-py#mset-msetnx-and-zadd

For ZADD, the dict is a mapping of element-names -> score.

So the dictionary generated for zadd() should be flipped around to have the
delivery_tag as the key and the score as value. This commit fixes that.

The changed `zadd()` behaviour in redis-py 3 states:
https://github.com/andymccurdy/redis-py#mset-msetnx-and-zadd

> For ZADD, the dict is a mapping of element-names -> score.

So the dictionary generated for `zadd()` should be flipped around to have the
`delivery_tag` as the key and the score as value. This commit fixes that.
@codecov
Copy link

codecov bot commented Nov 20, 2018

Codecov Report

Merging #953 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #953   +/-   ##
=======================================
  Coverage   88.66%   88.66%           
=======================================
  Files          63       63           
  Lines        6512     6512           
  Branches      777      777           
=======================================
  Hits         5774     5774           
  Misses        656      656           
  Partials       82       82
Impacted Files Coverage Δ
kombu/transport/redis.py 90.78% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4a06fc6...335921c. Read the comment docs.

@thedrow thedrow merged commit 5fca408 into celery:master Nov 20, 2018
@thedrow thedrow added this to the 4.3 milestone Nov 20, 2018
@Tenzer Tenzer deleted the fix-redis-py-zadd-order branch November 20, 2018 13:54
@ashb
Copy link
Contributor

ashb commented Nov 20, 2018

Thanks! Sorry I was making the change slightly blind to both how ZADD behaves (it's been a long time since I've done any redis directly) and without understanding how Kombu uses redis.

@peterbe
Copy link

peterbe commented Nov 30, 2018

Any chance to have a Pypi release of this?

lnielsen pushed a commit to inveniosoftware/invenio-indexer that referenced this pull request Dec 3, 2018
* Pins Redis library to <3.0.0 due to incompatibilities that has to be
  addressed in Kombu (celery/kombu#953). (closes #93)
thedrow pushed a commit that referenced this pull request Dec 6, 2018
The changed `zadd()` behaviour in redis-py 3 states:
https://github.com/andymccurdy/redis-py#mset-msetnx-and-zadd

> For ZADD, the dict is a mapping of element-names -> score.

So the dictionary generated for `zadd()` should be flipped around to have the
`delivery_tag` as the key and the score as value. This commit fixes that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants