Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds Redis-based caching support to Cachier, introducing a new Redis core implementation, accompanying tests, documentation updates, and CI integration.
- Implements
_RedisCoreinsrc/cachier/cores/redis.pyand wires it into thecachierdecorator. - Adds comprehensive tests for the Redis core under
tests/test_redis_core.pyand CI config for Redis. - Updates type definitions, examples, README, and CI workflows to support the new Redis backend.
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/cachier/cores/redis.py | New Redis core implementation for caching logic |
| src/cachier/core.py | Registers redis_client param and redis backend |
| src/cachier/_types.py | Extends Backend and defines RedisClient type |
| tests/test_redis_core.py | Tests covering Redis core features |
| tests/redis_requirements.txt | Test dependencies for Redis (redis, pandas, birch) |
| examples/redis_example.py | Example usage of the Redis backend |
| README.rst | Documentation section for Redis core |
| .github/workflows/ci-test.yml | CI pipeline steps and matrix for Redis tests |
Comments suppressed due to low confidence (3)
src/cachier/cores/redis.py:208
- There are no tests covering clear_being_calculated; consider adding a test in tests/test_redis_core.py to ensure entries marked as being calculated are correctly reset.
def clear_being_calculated(self) -> None:
src/cachier/core.py:109
- The decorator signature does not include a key_prefix parameter, so passing key_prefix to the Redis backend (as shown in the README) will cause an unexpected argument error. Consider adding key_prefix to the decorator parameters and passing it to _RedisCore.
def cachier(
examples/redis_example.py:57
- [nitpick] Calling setup_redis_client() directly may return None and cause a MissingRedisClient error. It’s better to pass the callable or guard the decorator application to ensure a valid client is provided.
@cachier(backend="redis", redis_client=setup_redis_client())
Co-authored-by: Copilot <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.