From 81563b06298fe3a64be6a89b583c3d64758ca12a Mon Sep 17 00:00:00 2001 From: Salem Jorden <115185670+SalemJorden@users.noreply.github.com> Date: Fri, 26 Jan 2024 07:12:04 -0600 Subject: [PATCH] docs: update to use API (#1781) Co-authored-by: Salem Boyland Co-authored-by: Kira --- samples/query_external_gcs_temporary_table.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/query_external_gcs_temporary_table.py b/samples/query_external_gcs_temporary_table.py index d622ab1a3..e0bc8438f 100644 --- a/samples/query_external_gcs_temporary_table.py +++ b/samples/query_external_gcs_temporary_table.py @@ -38,8 +38,8 @@ def query_external_gcs_temporary_table() -> None: # Example query to find states starting with 'W'. sql = 'SELECT * FROM `{}` WHERE name LIKE "W%"'.format(table_id) - query_job = client.query(sql, job_config=job_config) # Make an API request. + results = client.query_and_wait(sql, job_config=job_config) # Make an API request. - w_states = list(query_job) # Wait for the job to complete. + w_states = list(results) # Wait for the job to complete. print("There are {} states with names starting with W.".format(len(w_states))) # [END bigquery_query_external_gcs_temp]