Skip to content

refactor: rename SerializationWrapper methods to be backend-agnostic - #28

Merged
27Bslash6 merged 1 commit into
mainfrom
refactor/serialization-wrapper-naming
Dec 17, 2025
Merged

27Bslash6 merged 1 commit into
mainfrom
refactor/serialization-wrapper-naming

Conversation

@27Bslash6

Copy link
Copy Markdown
Contributor

Summary

  • Removes Redis-specific naming from the generic SerializationWrapper
  • wrap_for_redis()wrap()
  • unwrap_from_redis()unwrap()
  • Updates docstrings/comments in cache_handler.py to use "cache" instead of "Redis"

The SerializationWrapper creates a JSON envelope with base64-encoded payload - this format is backend-agnostic and works with any cache backend (Redis, CachekitIO, Memcached, etc.). The "redis" naming was a leaky abstraction.

Pre-commit fix

Also fixes the basedpyright pre-commit hook to:

  • Use venv directly (.venv/bin/basedpyright) instead of uv run to avoid modifying uv.lock
  • Add --level error to match Makefile behavior (fail on errors only, not warnings)

Test plan

  • make quick-check passes
  • All existing tests pass
  • Pre-commit hooks pass

Remove Redis-specific naming from the generic serialization wrapper:
- wrap_for_redis() → wrap()
- unwrap_from_redis() → unwrap()

The SerializationWrapper creates a JSON envelope with base64-encoded
payload - this format is backend-agnostic and works with any cache
backend (Redis, CachekitIO, Memcached, etc.). The "redis" naming was
a historical artifact that incorrectly implied Redis coupling.

Also updated related docstrings/comments in cache_handler.py to use
"cache" instead of "Redis" for consistency.

Pre-commit fix: Use venv basedpyright directly with --level error to
avoid uv.lock modification and match Makefile behavior.
@codecov

codecov Bot commented Dec 17, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/cachekit/serializers/wrapper.py 80.00% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@27Bslash6
27Bslash6 merged commit bc80fe9 into main Dec 17, 2025
37 checks passed
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