redis / redis-py

Redis Python client
MIT License
12.71k stars 2.53k forks source link

Please add zmscore #1435

Closed bionicles closed 3 years ago

bionicles commented 3 years ago

Version: 3.5.3

Platform: Python 3.8

Description: Dear Redis-Py Maintainers,

I love your work and use it in multiple big projects for coronavirus and algotrading stocks.

Recently I found a use for one of the new 6.2 commands called ZMSCORE and request we add it:

Here's a minimal test case:

from redis import Redis
def test_zmscore():
    r = Redis()
    r.zadd("hall_of_fame", {"alice": 1.0, "bob": 2.0})
    scores = r.zmscore("hall_of_fame", "alice", "bob")
    return scores

if __name__ == "__main__":
    scores = test_zmscore()
    assert scores == [1.0, 2.0]

Here's the current output of the failing test case:

AttributeError: 'Redis' object has no attribute 'zmscore'

I'd like to add this myself but unfortunately I'm new to the codebase.

What is the most efficient way to add new commands?

Happy holidays, Bion

jiekun commented 3 years ago

Hello. Thanks for pointing it out. I try to add support to this command and others new in 6.2 step by step. But I assume @andymccurdy will tag a new release AFTER redis 6.2 stable build is out (which may take a long time).

chayim commented 3 years ago

Available in the latest master, and will be in the upcoming release. Closing.