Match async Redis interface with sync + introduce aioredis integration tests#293
Match async Redis interface with sync + introduce aioredis integration tests#293ekzhu merged 8 commits intoekzhu:masterfrom
Redis interface with sync + introduce aioredis integration tests#293Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends the async storage layer to support Redis alongside MongoDB, matching the async Redis interface with the sync version, and introduces parametrized integration tests that run against both storage backends.
Key changes:
- Parametrized async LSH tests to run for both MongoDB (
aiomongo) and Redis (aioredis) storage backends - Added missing
close()method toAsyncRedisStoragefor proper resource cleanup - Enhanced
remove()andremove_val()methods in async Redis storage to support buffered deletion viabufferparameter, matching the sync interface - Added validation to enforce bytes-only keys when
prepickle=False, with helpful error messages
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Adds pytest-asyncio and backports-asyncio-runner dependencies for async test support |
| test/aio/test_lsh_mongo.py | Removed - consolidated into parametrized test suite |
| test/aio/test_lsh.py | New parametrized test file supporting both MongoDB and Redis storage backends, migrated from unittest to pytest |
| pyproject.toml | Adds pytest-asyncio test dependency and configures asyncio_mode = "auto" |
| datasketch/experimental/aio/storage.py | Implements close() method for AsyncRedisStorage and adds buffer parameter to remove() and remove_val() methods |
| datasketch/experimental/aio/lsh.py | Adds bytes key validation for prepickle=False mode and updates __setstate__ to preserve prepickle setting during unpickling |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 6 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@Varun0157 thanks for the PR! Apologies for the late response. |
Similar to #284, we
parametrizethe existing tests in the experimentalaiolayer to run for bothMongoDBandRedisstorage layers.On running the tests, the following issues were discovered and resolved:
AsyncRedisStoragedid not have aclosemethod - this has been addedThe following disparities from the sync storage were discovered and resolved:
bufferparameter was added toremove()andremove_val()to allow for buffered deletion and match the sync interfacebyteskeys are allowed ifprepickleisFalse.