algoliasearch-client-python icon indicating copy to clipboard operation
algoliasearch-client-python copied to clipboard

SearchIndex.search_async does not work. RuntimeWarning: coroutine 'TransporterAsync.retry' was never awaited

Open BioMingJiang opened this issue 1 year ago • 0 comments
trafficstars

  • Algolia CLient Version: 3.0.0
  • Language version: 3.12.3

Description I am trying to use SearchIndex.search_async, but running into issue with TransporterAsync.retry

traceback:

/opt/homebrew/Cellar/[email protected]/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/events.py:88: RuntimeWarning: coroutine 'TransporterAsync.retry' was never awaited
  self._context.run(self._callback, *self._args)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

Steps to reproduce

import asyncio
from algoliasearch.search_client_async import SearchClientAsync
from algoliasearch.search_index import SearchIndex

async def main():
    async with SearchClientAsync.create("abc", "def") as c:
        i = c.init_index("index`")
        r = await i.search_async('cell')
        print(r)


asyncio.run(main())

The sync version works

BioMingJiang avatar Jun 07 '24 21:06 BioMingJiang