Google BigQuery agent#


To install the BigQuery agent, run the following command:

pip install flytekitplugins-bigquery

Example usage#

For an example query, see BigQuery agent example.

Local testing#

To test the BigQuery agent locally, create a class for the agent task that inherits from AsyncAgentExecutorMixin. This mixin allows flytekit to mimic FlytePropeller’s behavior in calling the agent.

To test the BigQuery agent, copy the following code to a file called, modifying as needed.


When testing the BigQuery integration locally, you will need to set the GOOGLE_APPLICATION_CREDENTIALS environment variable.

Add AsyncAgentExecutorMixin to this class to tell flytekit to use the agent to run the task:

class BigQueryTask(AsyncAgentExecutorMixin, SQLTask[BigQueryConfig]):
    def __init__(self, name: str, **kwargs):

Flytekit will automatically use the agent to run the task in the local execution.

bigquery_doge_coin = BigQueryTask(
    query_template="SELECT * FROM `bigquery-public-data.crypto_dogecoin.transactions` WHERE version = @version LIMIT 10;",

You can run the above example task locally and test the agent with the following command:

$ unionai run bigquery_doge_coin --version 10

Union cluster deployment#

After you have finished testing the agent locally, contact the Union team to enable it in your cluster.