{"id":175,"library":"google-cloud-bigquery","title":"Google Cloud BigQuery","description":"Official Python client for Google BigQuery. Current version: 3.40.1 (Mar 2026). v3.0 made google-cloud-bigquery-storage and pyarrow required dependencies. Authentication uses Application Default Credentials (ADC) — no explicit API key. query() returns a QueryJob — must call .result() to wait for completion. to_dataframe() dtype behavior changed in v3 (nullable pandas dtypes). Python 3.9+ required as of v3.x.","status":"active","version":"3.40.1","language":"python","source_language":"en","source_url":"https://github.com/googleapis/python-bigquery","tags":["bigquery","google-cloud","python","data","sql","analytics"],"install":[{"cmd":"pip install google-cloud-bigquery","lang":"bash","label":"Python (core)"},{"cmd":"pip install 'google-cloud-bigquery[pandas]'","lang":"bash","label":"Python (with pandas/to_dataframe support)"},{"cmd":"pip install 'google-cloud-bigquery[pandas,pyarrow]'","lang":"bash","label":"Python (with pandas + pyarrow — recommended)"}],"dependencies":[{"reason":"Required in v3.x (previously optional). Installed automatically.","package":"google-cloud-bigquery-storage","optional":false},{"reason":"Required in v3.x (previously optional). Needed for to_dataframe() and Arrow-based result reading.","package":"pyarrow","optional":false},{"reason":"Required for pandas extra — maps BigQuery types to pandas nullable dtypes.","package":"db-dtypes","optional":true}],"imports":[{"wrong":"from google.cloud import bigquery","symbol":"bigquery","correct":"import google.cloud.bigquery"}],"quickstart":{"code":"# pip install 'google-cloud-bigquery[pandas]'\n# Set up ADC: gcloud auth application-default login\n# or set GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json\n\nfrom google.cloud import bigquery\n\nclient = bigquery.Client(project='my-gcp-project')\n\n# Query public dataset\nquery = \"\"\"\n    SELECT\n        name,\n        SUM(number) as total\n    FROM `bigquery-public-data.usa_names.usa_1910_2013`\n    WHERE state = 'CA'\n    GROUP BY name\n    ORDER BY total DESC\n    LIMIT 5\n\"\"\"\n\n# Run query and wait for results\nquery_job = client.query(query)\nrows = query_job.result()  # blocks until done\n\nfor row in rows:\n    print(f'{row.name}: {row.total}')\n\n# As DataFrame\ndf = rows.to_dataframe()\nprint(df.head())","lang":"python","description":"BigQuery Python client — query and to_dataframe with ADC auth."},"warnings":[{"fix":"pip install 'google-cloud-bigquery[pandas]' — installs all required deps including db-dtypes.","message":"google-cloud-bigquery-storage and pyarrow are now required dependencies in v3.x (previously optional). Installing v3 without them causes ImportError on to_dataframe().","severity":"breaking","affected_versions":">= 3.0"},{"fix":"Use pandas nullable dtypes in comparisons: df['col'].dtype == 'Int64' not 'int64'. Or use pd.api.types.is_integer_dtype().","message":"to_dataframe() dtype mappings changed in v3. INT64 → Int64 (nullable), BOOLEAN → boolean (nullable), DATE → dbdate. Code checking dtype == 'int64' or 'bool' will fail silently or raise.","severity":"breaking","affected_versions":">= 3.0"},{"fix":"rows = client.query(sql).result() — the .result() call is mandatory.","message":"client.query() returns a QueryJob — NOT results. It starts the job asynchronously. Must call .result() to block and wait for completion before iterating rows.","severity":"gotcha","affected_versions":"all"},{"fix":"Local: gcloud auth application-default login. Production: set GOOGLE_APPLICATION_CREDENTIALS=/path/to/key.json or use Workload Identity.","message":"Authentication uses Application Default Credentials (ADC) — no API key. Locally: run 'gcloud auth application-default login'. In production: use service account key or Workload Identity. Missing credentials raises DefaultCredentialsError.","severity":"gotcha","affected_versions":"all"},{"fix":"SELECT * FROM `myproject.mydataset.mytable` — backticks required for fully qualified table names.","message":"BigQuery table references use backtick syntax in SQL: `project.dataset.table`. Using regular quotes raises BadRequest syntax error.","severity":"gotcha","affected_versions":"all"},{"fix":"from google.cloud.bigquery import StandardSqlDataType — not from google.cloud.bigquery_v2","message":"StandardSqlDataType and related types moved from google.cloud.bigquery_v2 to google.cloud.bigquery in v3. Old imports raise ImportError.","severity":"gotcha","affected_versions":">= 3.0"},{"fix":"Use Python 3.9+","message":"Python 3.7 and 3.8 support dropped in v3.x. New major version in Q4 2024 dropped these Python versions.","severity":"gotcha","affected_versions":">= 3.0"}],"env_vars":null,"search_vec":"'2026':14 '3.40.1':12 '3.9':58 'adc':31 'analyt':70 'api':34 'applic':28 'authent':26 'behavior':50 'bigqueri':3,9,20,63 'call':41 'chang':51 'client':6 'cloud':2,19,66 'complet':46 'credenti':30 'current':10 'data':68 'datafram':48 'default':29 'depend':25 'dtype':49,56 'explicit':33 'googl':1,8,18,65 'google-cloud':64 'google-cloud-bigquery-storag':17 'key':35 'made':16 'mar':13 'must':40 'nullabl':54 'offici':4 'panda':55 'pyarrow':23 'python':5,57,67 'queri':36 'queryjob':39 'requir':24,59 'result':42 'return':37 'sql':69 'storag':21 'use':27 'v3':53 'v3.0':15 'v3.x':62 'version':11 'wait':44","created_at":"2026-03-25T02:43:55.143007+00:00","updated_at":"2026-04-16T15:20:02.133480+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":95,"quickstart_score":0,"quickstart_tag":"stale","pypi_latest":"3.41.0","cli_name":"","cli_version":null,"type":"library","homepage":"https://cloud.google.com/bigquery","github":"https://github.com/googleapis/python-bigquery","docs":null,"changelog":null,"pypi":"https://pypi.org/project/google-cloud-bigquery/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["gcp","database","data","serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-30","last_verified":"2026-06-30","next_check":"2026-07-30","install_tag":"verified"}}