-
-
Notifications
You must be signed in to change notification settings - Fork 17.6k
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
BUG: RuntimeWarning: coroutine 'AsyncCursor.execute' was never awaited #58557
Comments
this is the version that works with ThreadPoolExecutor, but seems to block: Here is the version that uses Thread Pooling
the concurrent futures code is this:
The output of the debug line from read_sql looks like this:
You'll notice that it is incrementing - id have expected it to be all roughly around the same time - so it seems there is some sql blocking. Also, the time gap between the first two threads and 3rd is always about 2-3 seconds - why is that? anyone know if the connection or pandas read_sql blocks? or how to solve? |
I have not had enough time to look at this, but from the issue title, shouldn't you tasks = {db_reader.read_sql_async(sql, params=p) for p in id_partitions} Because |
I am. You can see the await in the for/as_completed loop. I think the problem is prob an async connection or cusor doesn't work with pandas. If so, if like to understand if pandas blocks ..as per the 2nd example, why am I not able to achieve better concurrency |
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
the asyncio code is below
When i run this, im getting the following error:
The text was updated successfully, but these errors were encountered: