Nov 19, 2024
How to query a BigQuery table from Python
1. Install the SDK
dependencies = [
"google-cloud-bigquery[bqstorage, pandas]",
]2. Create a BigQuery client
from google.cloud import bigquery
bq_client = bigquery.Client(project="project")3. Query your data
query = """
SELECT column_one, column_two
FROM bq_table
WHERE column_three = true
"""
df = bq_client.query(query).to_dataframe()