Adding score_cast_func argument to zrank, zrevrank and zunion - for consistency with the other sorted sets commands by petyaslavova · Pull Request #3795 · redis/redis-py (original) (raw)

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds consistency to Redis sorted set commands by adding the score_cast_func parameter to zrank, zrevrank, and zunion commands, aligning them with other sorted set operations. It also ensures that score_cast_func is properly applied to both RESP2 and RESP3 protocol responses.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
redis/commands/core.py Adds score_cast_func parameter to zrank, zrevrank, and zunion methods
redis/_parsers/helpers.py Introduces new parser functions for handling score casting in rank operations for both RESP protocols
tests/test_commands.py Adds comprehensive test coverage for the new score_cast_func parameter functionality

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.