Skip to content

feat: add ListMixin and implement Redis list operations#802

Open
oliverhaas wants to merge 4 commits into
jazzband:masterfrom
oliverhaas:feat/list-operations-mixin
Open

feat: add ListMixin and implement Redis list operations#802
oliverhaas wants to merge 4 commits into
jazzband:masterfrom
oliverhaas:feat/list-operations-mixin

Conversation

@oliverhaas

Copy link
Copy Markdown
Contributor

No description provided.

@oliverhaas oliverhaas marked this pull request as draft December 13, 2025 13:29
@codecov

codecov Bot commented Dec 13, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 21.93309% with 210 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.0%. Comparing base (e0c234f) to head (5ed9392).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
tests/test_backend_lists.py 3.6% 135 Missing ⚠️
django_redis/client/mixins/lists.py 42.2% 20 Missing and 35 partials ⚠️
django_redis/cache.py 33.4% 20 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master    #802     +/-   ##
========================================
- Coverage    38.2%   37.0%   -1.1%     
========================================
  Files          48      50      +2     
  Lines        3727    3993    +266     
  Branches      301     336     +35     
========================================
+ Hits         1420    1476     +56     
- Misses       2006    2181    +175     
- Partials      301     336     +35     
Flag Coverage Δ
mypy 37.0% <22.0%> (-1.1%) ⬇️

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.

Changed list method parameters to use 'key' instead of 'name' to align
with Redis/Valkey terminology and maintain consistency with other
django-redis methods.

All 10 list methods updated:
- lpush(key, *values, ...)
- rpush(key, *values, ...)
- lpop(key, count, ...)
- rpop(key, count, ...)
- lrange(key, start, end, ...)
- lindex(key, index, ...)
- llen(key, ...)
- lrem(key, count, value, ...)
- ltrim(key, start, end, ...)
- lset(key, index, value, ...)

All 192 list operation tests pass.
@oliverhaas oliverhaas marked this pull request as ready for review December 24, 2025 13:12
@terencehonles

Copy link
Copy Markdown
Contributor

Same as #804

@oliverhaas do you mind sync'ing master? You can probably use the --ours merge conflict resolve strategy and then run pre-commit until it's stable to fix changes due to ruff causing conflicts. That should get you most of the way and then you can look at the diff to see if there are other changes you need to make. Alternatively, and possibly easier, you can just move the methods again.

Once you have done so, can you add a test that runs a diff against the redis.commands.core class you are mirroring and ensure that all methods are implemented (possibly with an exclude/skip list for methods that don't make sense here or maybe need to be implemented later if there are many)

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.

2 participants