From 85aca32f449aba7cde080dc52c90d8aef66d3345 Mon Sep 17 00:00:00 2001 From: Salem Boyland Date: Tue, 16 Jan 2024 15:40:12 -0600 Subject: [PATCH 1/2] docs: update client_query_destination_table.py to use query_and_wait API --- samples/client_query_destination_table.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/client_query_destination_table.py b/samples/client_query_destination_table.py index 486576fea..e270af3f7 100644 --- a/samples/client_query_destination_table.py +++ b/samples/client_query_destination_table.py @@ -32,8 +32,8 @@ def client_query_destination_table(table_id: str) -> None: """ # Start the query, passing in the extra configuration. - query_job = client.query(sql, job_config=job_config) # Make an API request. - query_job.result() # Wait for the job to complete. + request = client.query_and_wait(sql, job_config=job_config) # Make an API request. + request.result() # Wait for the job to complete. print("Query results loaded to the table {}".format(table_id)) # [END bigquery_query_destination_table] From 82ac16f9fa0a35087d12888fb93971a5c4c45da8 Mon Sep 17 00:00:00 2001 From: Salem Boyland Date: Tue, 23 Jan 2024 11:05:42 -0600 Subject: [PATCH 2/2] docs: update client_query_destination_table.py to use query_and_wait API --- samples/client_query_destination_table.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/samples/client_query_destination_table.py b/samples/client_query_destination_table.py index e270af3f7..f6a622229 100644 --- a/samples/client_query_destination_table.py +++ b/samples/client_query_destination_table.py @@ -32,8 +32,9 @@ def client_query_destination_table(table_id: str) -> None: """ # Start the query, passing in the extra configuration. - request = client.query_and_wait(sql, job_config=job_config) # Make an API request. - request.result() # Wait for the job to complete. + client.query_and_wait( + sql, job_config=job_config + ) # Make an API request and wait for the query to finish. print("Query results loaded to the table {}".format(table_id)) # [END bigquery_query_destination_table]