Python Connector for Google BigQuery

Connecting to Google BigQuery - Python Connector for Google BigQuery

Connecting to Google BigQuery

To establish a connection to Google BigQuery, import the connector and use the connect() method with your connection parameters.

Step 1. Import the connector

First, import the BigQuery connector module:

import devart.bigquery as bigquery

Step 2. Establish a connection

Call the connect() method with the connection parameters for your BigQuery server and obtain a connection object.

response = bigquery.signin()
my_connection = bigquery.connect(
    ProjectId="your_project_id",
    DataSetId="your_dataset_id",
    RefreshToken=response["Refresh Token"]
)

Replace the example values with your actual connection values.

For more information, see Connection parameters.

© 2022-2026 Devart. All Rights Reserved. Request Support Python Connectors Forum Provide Feedback