Skip to content

Commit

Permalink
Merge branch 'main' into salem_query_externalsheetspermanent_update
Browse files Browse the repository at this point in the history
  • Loading branch information
kiraksi committed Jan 26, 2024
2 parents da3ea0e + dbf10de commit 46ef13d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions samples/client_query_destination_table_legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
6 changes: 4 additions & 2 deletions samples/client_query_w_positional_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ def client_query_w_positional_params() -> None:
bigquery.ScalarQueryParameter(None, "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_positional]
4 changes: 2 additions & 2 deletions samples/query_to_arrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def query_to_arrow() -> "pyarrow.Table":
FROM races r
CROSS JOIN UNNEST(r.participants) as participant;
"""
query_job = client.query(sql)
arrow_table = query_job.to_arrow() # Make an API request.
results = client.query_and_wait(sql)
arrow_table = results.to_arrow() # Make an API request.

print(
"Downloaded {} rows, {} columns.".format(
Expand Down

0 comments on commit 46ef13d

Please sign in to comment.