Skip to content

BigQuery guide

Install the BigQuery extra:

pip install adbc-poolhouse[bigquery]

Or with uv:

uv add "adbc-poolhouse[bigquery]"

Auth methods

BigQueryConfig supports four auth methods via auth_type.

Application Default Credentials

When auth_type is unset, the driver uses Google Application Default Credentials. Run gcloud auth application-default login to configure them locally, or set GOOGLE_APPLICATION_CREDENTIALS to a service account key file path.

from adbc_poolhouse import BigQueryConfig, create_pool

config = BigQueryConfig(project_id="my-gcp-project")
pool = create_pool(config)

JSON credential file

config = BigQueryConfig(
    auth_type="json_credential_file",
    auth_credentials_path="/keys/service_account.json",
    project_id="my-gcp-project",
)

JSON credential string

Pass the key file contents directly as a string instead of a path:

config = BigQueryConfig(
    auth_type="json_credential_string",
    project_id="my-gcp-project",
)

Set BIGQUERY_AUTH_CREDENTIALS_PATH or supply the JSON string via your secrets manager before calling create_pool.

User authentication (OAuth)

config = BigQueryConfig(
    auth_type="user_authentication",
    auth_client_id="...",
    auth_client_secret="...",
    auth_refresh_token="...",
    project_id="my-gcp-project",
)

Loading from environment variables

BigQueryConfig reads all fields from environment variables with the BIGQUERY_ prefix:

export BIGQUERY_PROJECT_ID=my-gcp-project
export BIGQUERY_DATASET_ID=my_dataset
config = BigQueryConfig()  # reads from env

See also