File tree Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change
1
+ * 2.2.2
2
+ * Fixed a bug in ZREVRANK where retriving the rank of a value not in
3
+ the zset would raise an error.
1
4
* 2.2.1
2
5
* Changed archive name to redis-py-VERSION.tar.gz to not conflict
3
6
with the Redis server archive.
Original file line number Diff line number Diff line change @@ -218,7 +218,7 @@ class Redis(threading.local):
218
218
string_keys_to_dict (
219
219
'DECRBY GETBIT HLEN INCRBY LINSERT LLEN LPUSHX RPUSHX SCARD '
220
220
'SDIFFSTORE SETBIT SETRANGE SINTERSTORE STRLEN SUNIONSTORE ZCARD '
221
- 'ZREMRANGEBYRANK ZREMRANGEBYSCORE ZREVRANK ' ,
221
+ 'ZREMRANGEBYRANK ZREMRANGEBYSCORE' ,
222
222
int
223
223
),
224
224
string_keys_to_dict (
@@ -237,6 +237,7 @@ class Redis(threading.local):
237
237
lambda r : r and set (r ) or set ()
238
238
),
239
239
string_keys_to_dict ('ZRANGE ZRANGEBYSCORE ZREVRANGE' , zset_score_pairs ),
240
+ string_keys_to_dict ('ZRANK ZREVRANK' , int_or_none ),
240
241
{
241
242
'BGREWRITEAOF' : lambda r : \
242
243
r == 'Background rewriting of AOF file started' ,
@@ -249,7 +250,6 @@ class Redis(threading.local):
249
250
'PING' : lambda r : r == 'PONG' ,
250
251
'RANDOMKEY' : lambda r : r and r or None ,
251
252
'TTL' : lambda r : r != - 1 and r or None ,
252
- 'ZRANK' : int_or_none ,
253
253
}
254
254
)
255
255
Original file line number Diff line number Diff line change @@ -891,6 +891,7 @@ def test_zrevrank(self):
891
891
self .assertEquals (self .client .zrevrank ('a' , 'a3' ), 2 )
892
892
self .assertEquals (self .client .zrevrank ('a' , 'a4' ), 3 )
893
893
self .assertEquals (self .client .zrevrank ('a' , 'a5' ), 4 )
894
+ self .assertEquals (self .client .zrevrank ('a' , 'b' ), None )
894
895
895
896
def test_zscore (self ):
896
897
# key is not a zset
You can’t perform that action at this time.
0 commit comments