From 89dfcb6469d22e78003a70371a0938a6856e033c Mon Sep 17 00:00:00 2001 From: Salem Jorden <115185670+SalemJorden@users.noreply.github.com> Date: Mon, 12 Feb 2024 17:39:04 -0600 Subject: [PATCH] docs: update `client_query_w_named_params.py` to use `query_and_wait` API (#1782) * docs: update client_query_w_named_params.py to use query_and_wait API * Update client_query_w_named_params.py lint --------- Co-authored-by: Salem Boyland Co-authored-by: Kira --- samples/client_query_w_named_params.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/samples/client_query_w_named_params.py b/samples/client_query_w_named_params.py index 6dd72d44f..b7e59a81a 100644 --- a/samples/client_query_w_named_params.py +++ b/samples/client_query_w_named_params.py @@ -33,8 +33,10 @@ def client_query_w_named_params() -> None: bigquery.ScalarQueryParameter("min_word_count", "INT64", 250), ] ) - query_job = client.query(query, job_config=job_config) # Make an API request. + results = client.query_and_wait( + query, job_config=job_config + ) # Make an API request. - for row in query_job: + for row in results: print("{}: \t{}".format(row.word, row.word_count)) # [END bigquery_query_params_named]