Skip to content

Correct order of Redis zadd dict elements#953

Merged
thedrow merged 1 commit into
celery:masterfrom
Tenzer:fix-redis-py-zadd-order
Nov 20, 2018
Merged

Correct order of Redis zadd dict elements#953
thedrow merged 1 commit into
celery:masterfrom
Tenzer:fix-redis-py-zadd-order

Conversation

@Tenzer

@Tenzer Tenzer commented Nov 20, 2018

Copy link
Copy Markdown
Contributor

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

codecov Bot commented Nov 20, 2018

Copy link
Copy Markdown

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

ashb commented Nov 20, 2018

Copy link
Copy Markdown
Contributor

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

peterbe commented Nov 30, 2018

Copy link
Copy Markdown

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