Refactor wrappers to use KVStoreProtocol and move to dedicated directory #4
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.
This PR refactors the wrapper classes to align with the clean separation of concerns in the KV store architecture by:
src/kv_store_adapter/wrappers/directory alongside adaptersKVStoreProtocolinterface instead of inheriting fromBaseKVStoreWhat Changed
Interface Simplification
Wrappers now implement only the 4 core KVStoreProtocol methods:
get(collection, key)put(collection, key, value, ttl=None)delete(collection, key)exists(collection, key)Management operations like
ttl(),keys(),clear_collection(),list_collections(), andcull()are no longer part of the wrapper interface, making them purely focused on the core KV operations.Directory Structure
Example Usage
The refactored wrappers maintain full functionality while using the cleaner protocol interface:
Benefits
Testing
BaseProtocolTestsclass provides protocol-specific test coverageThe change is backwards compatible for import paths - users just need to update from
kv_store_adapter.stores.wrapperstokv_store_adapter.wrappers.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
astral.shcurl -LsSf REDACTED(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
Fixes #3
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.