Skip to content

feat(supabase): add async support to SupabaseGroongaDocumentStore and SupabaseGroongaBM25Retriever#3380

Open
Aftabbs wants to merge 1 commit into
deepset-ai:mainfrom
Aftabbs:feat/supabase-groonga-async-support
Open

feat(supabase): add async support to SupabaseGroongaDocumentStore and SupabaseGroongaBM25Retriever#3380
Aftabbs wants to merge 1 commit into
deepset-ai:mainfrom
Aftabbs:feat/supabase-groonga-async-support

Conversation

@Aftabbs
Copy link
Copy Markdown
Contributor

@Aftabbs Aftabbs commented Jun 1, 2026

Summary

  • Adds warm_up_async() and a full set of *_async() methods to SupabaseGroongaDocumentStore using supabase-py's AsyncClient and acreate_client
  • Fixes SupabaseGroongaBM25Retriever.run_async(), which was a stub that delegated to the synchronous run() instead of using real async I/O
  • Adds 14 new unit tests for the async path across both classes

Closes #3379

Root Cause

supabase-py ships two parallel clients: create_client (sync) and acreate_client (async). The original implementation only wired up the sync client. run_async() on the retriever simply called self.run(), blocking the event loop on every invocation — making AsyncPipeline usage effectively synchronous.

Changes

File What changed
groonga_document_store.py Added _async_client field; 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.py Fixed run_async() to call _groonga_retrieval_async(); removed stale docstring note saying async is unsupported
test_groonga_document_store.py Added TestDocumentStoreAsync class with 12 async unit tests using AsyncMock for the async client
test_groonga_retriever.py Updated test_run_async to verify _groonga_retrieval_async is actually awaited (not the sync path)

Testing

  • Existing sync tests pass (no sync code was changed)
  • New async tests: TestDocumentStoreAsync — 12 tests covering warm_up, count, filter, write (OVERWRITE/SKIP/FAIL policies), delete, delete_all, retrieval, and uninitialized-client guard
  • Retriever test: test_run_async_uses_async_retrieval — asserts _groonga_retrieval_async is awaited
  • ruff check passes with no errors

Impact

Users running SupabaseGroongaBM25Retriever inside an AsyncPipeline now get true non-blocking I/O instead of a blocking call that defeats the purpose of async execution.

… 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
@Aftabbs Aftabbs requested a review from a team as a code owner June 1, 2026 18:11
@Aftabbs Aftabbs requested review from sjrl and removed request for a team June 1, 2026 18:11
@github-actions github-actions Bot added integration:supabase type:documentation Improvements or additions to documentation labels Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration:supabase type:documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add async support to SupabaseGroongaDocumentStore and SupabaseGroongaBM25Retriever

1 participant