From cf0d0b8d0bae0585ad50502dafc5e38c1eec36bb Mon Sep 17 00:00:00 2001 From: Tim Swena Date: Fri, 13 Dec 2024 14:44:51 -0600 Subject: [PATCH] docs(python): Include parquet options in BigQuery I/O write sample This ensures lists are interpreted correctly by BigQuery. --- docs/source/src/python/user-guide/io/bigquery.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/source/src/python/user-guide/io/bigquery.py b/docs/source/src/python/user-guide/io/bigquery.py index 7628213f6695..3b74bb163008 100644 --- a/docs/source/src/python/user-guide/io/bigquery.py +++ b/docs/source/src/python/user-guide/io/bigquery.py @@ -25,12 +25,15 @@ with io.BytesIO() as stream: df.write_parquet(stream) stream.seek(0) + parquet_options = bigquery.ParquetOptions() + parquet_options.enable_list_inference = True job = client.load_table_from_file( stream, destination='tablename', project='projectname', job_config=bigquery.LoadJobConfig( source_format=bigquery.SourceFormat.PARQUET, + parquet_options=parquet_options, ), ) job.result() # Waits for the job to complete