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

Python: adds ZSCORE command #877

Merged
merged 1 commit into from
Feb 1, 2024
Merged

Conversation

shohamazon
Copy link
Collaborator

No description provided.

@shohamazon shohamazon requested a review from a team as a code owner January 30, 2024 11:15
member (str): The member whose score is to be retrieved.

Returns:
Optional[float]: The score of the member, or None if the member does not exist in the sorted set.
Copy link
Collaborator

@barshaul barshaul Feb 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description lacks that option of returning null if the key does not exist, please stick to the documentation in redis as I might have missed that

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

member (str): The member whose score is to be retrieved.

Commands response:
Optional[float]: The score of the member, or None if the member does not exist in the sorted set.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

key = get_random_string(10)
members_scores = {"one": 1, "two": 2, "three": 3}
assert await redis_client.zadd(key, members_scores=members_scores) == 3
assert await redis_client.zscore(key, "one") == 1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please test it with a float, not an int

Copy link
Collaborator

@barshaul barshaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix & merge

@shohamazon shohamazon force-pushed the python/zscore branch 4 times, most recently from 4300e43 to 495c8f1 Compare February 1, 2024 12:57
@shohamazon shohamazon merged commit 51b2de3 into valkey-io:main Feb 1, 2024
27 checks passed
@shohamazon shohamazon deleted the python/zscore branch February 1, 2024 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants