Skip to content

refactor: rename 'name' parameter to 'key' in sorted set methods#811

Open
oliverhaas wants to merge 2 commits intojazzband:masterfrom
oliverhaas:refactor/rename-name-to-key
Open

refactor: rename 'name' parameter to 'key' in sorted set methods#811
oliverhaas wants to merge 2 commits intojazzband:masterfrom
oliverhaas:refactor/rename-name-to-key

Conversation

@oliverhaas
Copy link
Copy Markdown
Contributor

@oliverhaas oliverhaas commented Dec 24, 2025

This is a follow up of #798.

I've just chosen a bad arg naming, which I only noticed when I worked on the hash methods.

NOTE: redis-py unfortunately was the cause for this confusion. What the Redis docs call key is name in the redis-py code. I suggest that this project stays with key for well... the key, just like apparently everyone (incl. Redis and Valkey docs) does except the redis-py code.

Changed all sorted set methods to use 'key' instead of 'name' as the
parameter name for the Redis key. This improves consistency with Redis
terminology where 'key' refers to the Redis key and aligns better with
the rest of the codebase.

Changed methods:
- zadd
- zcard
- zcount
- zincrby
- zpopmax
- zpopmin
- zrange
- zrangebyscore
- zrank
- zrem
- zremrangebyscore
- zrevrange
- zrevrangebyscore
- zscore

All tests pass with the new parameter naming.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 24, 2025

Codecov Report

❌ Patch coverage is 67.85714% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.2%. Comparing base (755dfb2) to head (ce2df89).

Files with missing lines Patch % Lines
django_redis/client/mixins/sorted_sets.py 67.9% 3 Missing and 6 partials ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##           master    #811   +/-   ##
======================================
  Coverage    38.2%   38.2%           
======================================
  Files          48      48           
  Lines        3727    3727           
  Branches      301     301           
======================================
  Hits         1420    1420           
  Misses       2006    2006           
  Partials      301     301           
Flag Coverage Δ
mypy 38.2% <67.9%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@oliverhaas oliverhaas marked this pull request as ready for review December 24, 2025 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant