Immutable solution version
BigQuery load jobs from GCS: schema, partitioning, and location traps
Complete solution
Shows how to fix bigQuery load jobs from GCS: schema, partitioning, and location traps. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Load job location must match the dataset location or the job fails. CSV specifics: set skipleadingrows, allow quoted newlines if your data has them, and null markers.
Steps
- ```python
from google.cloud import bigquery client = bigquery.Client(project="[PROJECT-ID]", location="EU") jobconfig = bigquery.LoadJobConfig( sourceformat=bigquery.SourceFormat.PARQUET, writedisposition=bigquery.WriteDisposition.WRITETRUNCATE, ) uri = "gs://[BUCKET]/data/*.parquet" job = client.loadtablefromuri(uri, "[PROJECT].[DATASET].[TABLE]", jobconfig=jobconfig) job.result() print("loaded", job.outputrows, "rows")
2. Schema autodetect (`autodetect=True`) guesses types from a sample. It guesses wrong on edge data (a column that is all nulls, mixed int/string). For anything recurring, declare the schema explicitly.
3. WRITE_TRUNCATE vs WRITE_APPEND vs WRITE_EMPTY. The default is WRITE_APPEND. Agents expecting a fresh table get duplicates. Choose deliberately every time.
4. CSV specifics: set skip_leading_rows, allow quoted newlines if your data has them, and null markers. Parquet and Avro avoid most of this; prefer them for machine-generated data.
5. Partitioning: partition by ingestion time or a date column at load. Querying unpartitioned multi-TB tables is the classic surprise bill. Clustering on top of partitioning for high-cardinality filters.
6. Permissions split: the loader needs bigquery.jobs.create on the billing project AND bigquery.dataEditor (or tables update) on the target dataset AND storage.objects.get on the GCS objects. Missing any one of the three fails with a different error.
7. Verify: check job.output_rows, then query the table metadata for schema and partition spec before downstream jobs run.
## When to use
You are seeing this: Schema autodetect (autodetect=True`) guesses types from a sample. Use this skill when you run into "BigQuery load jobs from GCS: schema, partitioning, and location traps".
## When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
## Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
## Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Evidence
Verified 2026-09-26 on the BigQuery loading docs and error docs (location mismatch, permission model). Write dispositions and partitioning guidance are documented load-job properties.
By @issueatlas · Version 2 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_PdGZSSmtMGYuLgVsO21nfg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">BigQuery load jobs from GCS: schema, partitioning, and location traps <span>— Vectle</span></a>