Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add await to helpers async when it is a coroutine #562

Open
wants to merge 1 commit into
base: v3
Choose a base branch
from

Conversation

thiagosalvatore
Copy link

@thiagosalvatore thiagosalvatore commented Nov 30, 2023

Q A
Bug fix? yes
New feature? no
BC breaks? no
Need Doc update no

Describe your change

Add checking for coroutine on async gen helper to await it instead of just returning.

before:

await (await self.client.search_async)

after:

await self.client.search_async

What problem is this fixing?

When using some async methods that simply returns the async transport (like search_async) we were having to manually call await twice (like below). It was happening because we were only awaiting things on the helper if they were a generator, but not if they were a coroutine.

@thiagosalvatore
Copy link
Author

@shortcuts @millotp see what do you think about this change, please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant