This may be a dummy question but I cannot seem to be able to run python google-clood-bigquery asynchronously.
My goal is to run multiple queries concurrently and wait for all to finish in an asyncio.wait()
query gatherer. I'm using asyncio.create_tast()
to launch the queries.
The problem is that each query waits for the precedent one to complete before starting.
Here is my query function (quite simple):
async def exec_query(self, query, **kwargs) -> bigquery.table.RowIterator:
job = self.api.query(query, **kwargs)
return job.result()
Since I cannot await job.result()
should I await something else?
asyncio
? Bigquery's python api has no support for async yeild so better option probably would be to execute the queries on background at some ThreadPool executor. – Moreira