feat(supabase): add async support to SupabaseGroongaDocumentStore and SupabaseGroongaBM25Retriever#3380
Open
Aftabbs wants to merge 1 commit into
Open
Conversation
… SupabaseGroongaBM25Retriever Implements the full async interface for the Groonga document store using supabase-py's AsyncClient and acreate_client. SupabaseGroongaBM25Retriever.run_async() previously delegated to the synchronous run() path instead of using real async I/O. Closes deepset-ai#3379
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.
Summary
warm_up_async()and a full set of*_async()methods toSupabaseGroongaDocumentStoreusingsupabase-py'sAsyncClientandacreate_clientSupabaseGroongaBM25Retriever.run_async(), which was a stub that delegated to the synchronousrun()instead of using real async I/OCloses #3379
Root Cause
supabase-pyships two parallel clients:create_client(sync) andacreate_client(async). The original implementation only wired up the sync client.run_async()on the retriever simply calledself.run(), blocking the event loop on every invocation — makingAsyncPipelineusage effectively synchronous.Changes
groonga_document_store.py_async_clientfield;warm_up_async(),_setup_table_async(), and async counterparts for all public methods (count_documents_async,filter_documents_async,write_documents_async,delete_documents_async,delete_all_documents_async,delete_by_filter_async,update_by_filter_async,_groonga_retrieval_async)groonga_bm25_retriever.pyrun_async()to call_groonga_retrieval_async(); removed stale docstring note saying async is unsupportedtest_groonga_document_store.pyTestDocumentStoreAsyncclass with 12 async unit tests usingAsyncMockfor the async clienttest_groonga_retriever.pytest_run_asyncto verify_groonga_retrieval_asyncis actually awaited (not the sync path)Testing
TestDocumentStoreAsync— 12 tests covering warm_up, count, filter, write (OVERWRITE/SKIP/FAIL policies), delete, delete_all, retrieval, and uninitialized-client guardtest_run_async_uses_async_retrieval— asserts_groonga_retrieval_asyncis awaitedruff checkpasses with no errorsImpact
Users running
SupabaseGroongaBM25Retrieverinside anAsyncPipelinenow get true non-blocking I/O instead of a blocking call that defeats the purpose of async execution.