Skip to main content

BigQuery ADBC driver for Python

bigquery-adbc bundles the native BigQuery ADBC driver and loads it through adbc-driver-manager. Requires Python 3.11 or newer.

This project is experimental and AI-generated, and has not seen real-world use. See the known limitations.

Install

python3 -m pip install "bigquery-adbc[dbapi]"

The dbapi extra installs PyArrow; the pandas extra also adds pandas for cursor.fetch_df(). The low-level bigquery_adbc.connect() API needs neither.

To build from source, install Rust, then run this from the repository root. The build uses the repository's pinned Rust toolchain:

python3 -m pip install "./python[dbapi]"

To install a built wheel, replace ./python with its path.

Usage

The driver uses Application Default Credentials (ADC) by default. For local development, set them up with:

gcloud auth application-default login

Replace my-gcp-project with a project where those credentials can run BigQuery jobs:

from bigquery_adbc import dbapi

with dbapi.connect("bigquery:///my-gcp-project", autocommit=True) as connection:
    with connection.cursor() as cursor:
        cursor.execute("SELECT 1")
        print(cursor.fetchone())

The low-level ADBC API can take its whole configuration as options:

import bigquery_adbc as bigquery

with bigquery.connect(
    db_kwargs={
        bigquery.DatabaseOptions.PROJECT_ID: "my-gcp-project",
    }
) as database:
    print(database.get_option(bigquery.DatabaseOptions.PROJECT_ID))

bigquery.connect() returns an adbc_driver_manager.AdbcDatabase; dbapi.connect() returns a DB-API connection. Both accept a URI, db_kwargs, or both, and explicit options override URI parameters. See connection URIs for dataset, location, quota-project and impersonation settings.

Transactions, batching, and errors

Use autocommit=True for independent queries. With the PEP 249 default, autocommit=False, the first query that needs a transaction opens a BigQuery session. BigQuery rejects permanent-table DDL such as CREATE TABLE inside a transaction, and the driver rejects adbc_ingest. Leaving the with block rolls back uncommitted work; call connection.commit() first to keep it.

executemany runs one BigQuery job per parameter row. For bulk inserts, use cursor.adbc_ingest, which streams rows through the Storage Write API. On a reused cursor, an adbc_ingest call that omits catalog_name or db_schema_name keeps the previous call's value; pass "" for the connection's default (UP-95).

Invalid credentials raise ProgrammingError; transient token-exchange failures raise OperationalError. Catch dbapi.DatabaseError to handle both. See error statuses.

Set ADBC_DRIVER_BIGQUERY_LOG_LEVEL=warn before the first connect() to log Storage Read fallbacks and failed cancellations to standard error; debug also logs retries. Jupyter shows these in the kernel console. See diagnostics.

Options

Configure database and connection options when connecting, and statement options on a cursor:

Enum Set with Examples
DatabaseOptions connect(db_kwargs={...}) Credentials, project, dataset and location.
ConnectionOptions dbapi.connect(conn_kwargs={...}) Catalog, schema and result reading.
StatementOptions cursor.adbc_statement.set_options(**{...}) Parameters, query limits and ingestion.

Pass autocommit as a keyword to dbapi.connect(), not in conn_kwargs. New statements inherit their connection's read controls and bulk-ingest method.

Option enums are StrEnums and work directly as keys and values: str(DatabaseOptions.PROJECT_ID) is "bigquery.project_id". The manager's typed getters need .value, for example statement.get_option_float(StatementOptions.PROGRESS.value).

BulkIngestMethod.STORAGE_WRITE is the only supported bulk-ingest method; the raw value "load" returns NOT_IMPLEMENTED. StatementOptions.QUERY_MAXIMUM_BILLING_TIER also returns NOT_IMPLEMENTED; use QUERY_MAXIMUM_BYTES_BILLED to cap query cost.

See the option reference for defaults, constraints, and write-only credential options. Reading uri returns the configured URI with credentials redacted; read individual options to see the effective configuration.

Local builds

Use uv for builds and development. From the repository root:

scripts/build-python-package.sh
uvx twine check dist/*
uvx check-wheel-contents dist/*.whl

The script writes a source distribution and a wheel to dist/; uv build inside python/ writes them to python/dist/.

Wheels include LICENSE, NOTICE, the complete collected dependency license texts, and the Rust standard-library notices under their .dist-info/licenses/ directory. Source distributions carry the same bundle. Builds reject a bundle that no longer matches the dependency manifests, lockfile, or Rust version. See distribution packaging for regeneration and native release archives.

Wheel builds run cargo rustc --release --locked --lib --crate-type cdylib. The build checks the library's format, architecture and ADBC exports, then derives the wheel's platform tag from it. Explicit platform tags and multi-architecture libraries are rejected.

Environment variable Effect
BIGQUERY_ADBC_BUILD_LIBRARY At build time, package the library at this absolute path instead of running Cargo. The same checks run.
BIGQUERY_ADBC_LIBRARY At runtime, load a development library from this path instead of the bundled one.

The enums in python/src/bigquery_adbc/_options.py are generated from the Rust option declarations, and cargo test checks that they are current. After changing an option key, value or Python exposure, regenerate them from the repository root:

cargo run --locked --features python-option-codegen --bin generate-python-options

Local Linux builds carry a linux_<arch> development tag. Build portable release wheels with cibuildwheel:

uvx --from 'cibuildwheel[uv]==4.3.5' cibuildwheel --output-dir target/wheelhouse python

The wheel workflow builds and install-tests py3-none wheels for Linux x86-64 and AArch64 (manylinux 2.28), macOS x86-64 and arm64, and Windows x86-64. Each wheel contains one architecture and works across the supported Python versions.

Local tests

From the repository root, run the same offline checks as CI:

scripts/run-python-lint.sh
scripts/run-offline-python-tests.sh

The scripts install locked dependencies and check the package and integration helpers. They need neither credentials nor a native driver build. To run an individual package test or apply formatting:

uv run --project python --locked pytest -q python/tests/test_api.py
uv run --project python --locked ruff format python

Ruff is configured in python/ruff.toml and Pyrefly in python/pyproject.toml.

An editable install does not compile Rust. To use a native driver from it, build the library from the repository root and set its path:

cargo rustc --release --locked --lib --crate-type cdylib
export BIGQUERY_ADBC_LIBRARY="$PWD/target/release/libadbc_driver_bigquery.so"
uv run --project python --locked python

Use libadbc_driver_bigquery.dylib on macOS or adbc_driver_bigquery.dll on Windows.

The live suite builds a fresh wheel and tests it in an isolated environment, using ADC. It installs the driver manager from the same pinned ADBC revision as the Rust tests; CI's installed-wheel tests separately cover the released driver manager.

gcloud auth application-default login
export BIGQUERY_ADBC_INTEGRATION_TEST_GCP_PROJECT=my-project
scripts/run-python-tests.sh
scripts/run-python-tests.sh -k parameter_binding

BIGQUERY_ADBC_INTEGRATION_TEST_GCP_PROJECT must name a project where your credentials can run queries and create datasets. It is required, including in emulator mode; missing or empty values fail, with no default or fallback to the active gcloud project. Each run creates a uniquely named, labelled dataset whose tables expire after one day. Cleanup drops a dataset only if its prefix and ownership labels match.

To run the same Python suite against a running BigQuery emulator instead, explicitly set both service endpoints. Real BigQuery remains the default:

ADBC_BIGQUERY_EMULATOR_REST_ENDPOINT=http://127.0.0.1:9050 \
ADBC_BIGQUERY_EMULATOR_STORAGE_ENDPOINT=http://127.0.0.1:9060 \
scripts/run-python-tests.sh -k select_through_low_level_and_dbapi

Set both variables to HTTP or HTTPS origins, without paths or credentials; a partial or invalid configuration fails before the build. The runner bypasses ADC checks and directs all service requests to the emulator using anonymous authentication. The package itself does not read these test-only variables. Dataset cleanup still checks ownership labels, but emulator fixtures omit table expiration. Remove -k to attempt the complete suite; emulator incompatibilities remain test failures. See the repository's emulator instructions for starting one and the current validation scope.

Metadata

Release files for bigquery-adbc 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for bigquery-adbc 0.1.0
File Actions
bigquery_adbc-0.1.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for bigquery_adbc-0.1.0-py3-none-win_amd64.whl
bigquery_adbc-0.1.0-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details for bigquery_adbc-0.1.0-py3-none-manylinux_2_28_x86_64.whl
bigquery_adbc-0.1.0-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details for bigquery_adbc-0.1.0-py3-none-manylinux_2_28_aarch64.whl
bigquery_adbc-0.1.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for bigquery_adbc-0.1.0-py3-none-macosx_11_0_arm64.whl
bigquery_adbc-0.1.0-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details for bigquery_adbc-0.1.0-py3-none-macosx_10_12_x86_64.whl

Total release size: 20.7 MB

Release files / bigquery_adbc-0.1.0-py3-none-win_amd64.whl

Download URL bigquery_adbc-0.1.0-py3-none-win_amd64.whl
Size 4.5 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
2bd86dcff5d038fd84087da79ce0d14abaa42a3345de6fc6c3b4030c144a06b4
BLAKE2b-256 checksum
How to use checksums
77b723b33f1d1091635fb4d85fc3c056a90d2bcd69338681079534aa3eba4b1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Release files / bigquery_adbc-0.1.0-py3-none-manylinux_2_28_x86_64.whl

Download URL bigquery_adbc-0.1.0-py3-none-manylinux_2_28_x86_64.whl
Size 4.2 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
38091001557ae9b050dd5734afb2bc2250564f3f3dc37b3109237adc4e183dfc
BLAKE2b-256 checksum
How to use checksums
f8102df940b45277e1b09f486e6aeed64e43f6c74f049a31c53b245cf7c6b4d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Release files / bigquery_adbc-0.1.0-py3-none-manylinux_2_28_aarch64.whl

Download URL bigquery_adbc-0.1.0-py3-none-manylinux_2_28_aarch64.whl
Size 4.1 MB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
4b762796d485cb91d6b14a30a2ba74a32662811e95bb3c28beea0c1aa0dae1da
BLAKE2b-256 checksum
How to use checksums
88c3b71ad07ac18cd5c62acbceba1052847405d0346087231627349182b7aa2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Release files / bigquery_adbc-0.1.0-py3-none-macosx_11_0_arm64.whl

Download URL bigquery_adbc-0.1.0-py3-none-macosx_11_0_arm64.whl
Size 3.9 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ff4ef44dbe0d3f3ca3fdac73243a052ed0e9a6b4c022753f1e7676666a97cd51
BLAKE2b-256 checksum
How to use checksums
5c74f2b4db8d631e5a739eed73e859a557131d697d90f870083e0454d917c5c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Release files / bigquery_adbc-0.1.0-py3-none-macosx_10_12_x86_64.whl

Download URL bigquery_adbc-0.1.0-py3-none-macosx_10_12_x86_64.whl
Size 4.1 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
39a8e43c275f4955689d4d133221068bdb6f4a4f4e14765f6581f36d86f652fb
BLAKE2b-256 checksum
How to use checksums
76f74a805ca0b586fdca65f93435a3492a3f0d488e6843017500d16c577983a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Security for bigquery-adbc 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for bigquery_adbc-0.1.0-py3-none-win_amd64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page