From ef89f9e58c22b3af5a7757b69daa030116012350 Mon Sep 17 00:00:00 2001 From: Salem Jorden <115185670+SalemJorden@users.noreply.github.com> Date: Thu, 25 Jan 2024 15:39:41 -0600 Subject: [PATCH] Docs: update the query destination table legacy file to use query_and_wait API (#1775) * docs: update query destination table legacy file to use query_and_wait API * docs: update the query_destination_table_legacy.py to use the query_and_wait API --------- Co-authored-by: Salem Boyland Co-authored-by: Kira Co-authored-by: Chalmer Lowe --- samples/client_query_destination_table_legacy.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/samples/client_query_destination_table_legacy.py b/samples/client_query_destination_table_legacy.py index 37f50fdb4..26c3945ca 100644 --- a/samples/client_query_destination_table_legacy.py +++ b/samples/client_query_destination_table_legacy.py @@ -36,8 +36,9 @@ def client_query_destination_table_legacy(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. + 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_legacy_large_results]