[Python] Python - How to - Big Query asynchronous tasks

Discussão em 'Python' iniciado por Stack, Maio 13, 2025.

  1. Stack

    Stack Membro Participativo

    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?

    Continue reading...

Compartilhe esta Página