The `google-cloud-bigquery-reservation` library provides a Python client for the Google Cloud BigQuery Reservation API. This API allows users to manage BigQuery reservations, which are dedicated slots for running queries. The library is currently at version 1.23.0 and is part of the `google-cloud-python` monorepo, receiving frequent updates, often daily, alongside other Google Cloud client libraries.
pip install google-cloud-bigquery-reservationVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to instantiate the `ReservationServiceClient` and list existing BigQuery reservations within a specified Google Cloud project and location. Ensure your `GOOGLE_APPLICATION_CREDENTIALS` are set or you are authenticated via `gcloud` and have the necessary IAM permissions (e.g., `bigquery.reservations.list`).
Set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable to the path of your service account key file, or authenticate via `gcloud auth application-default login` for local development. Ensure the principal has `BigQuery Resource Admin` or equivalent IAM roles for reservation management.
Always check the `requires_python` metadata on PyPI for the specific version of `google-cloud-bigquery-reservation` you intend to use. Upgrade to a supported Python version (e.g., 3.10 or newer) to ensure compatibility across all Google Cloud libraries.
Always specify the correct region (e.g., `us-central1`, `eu-west1`) when listing, creating, or managing BigQuery reservation resources. Ensure the `parent` path in your API calls accurately reflects the resource's location.
Grant the appropriate IAM roles (e.g., `BigQuery Resource Admin`, `BigQuery Reservation User`) to the service account or user used for authentication. Verify the `GOOGLE_APPLICATION_CREDENTIALS` environment variable points to the correct key file.
Double-check the project ID, location, and the name/ID of the reservation or assignment resource in your API call. Ensure the resource actually exists and is accessible from the specified location.
Use the versioned import path: `from google.cloud.bigquery_reservation_v1 import ReservationServiceClient`.