Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions docs/snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,13 +465,12 @@ def test_client_query_total_rows(client, capsys):
'WHERE state = "TX" '
"LIMIT 100"
)
query_job = client.query(
results = client.query_and_wait(
query,
# Location must match that of the dataset(s) referenced in the query.
location="US",
) # API request - starts the query
) # API request - starts the query and waits for results.

results = query_job.result() # Wait for query to complete.
print("Got {} rows.".format(results.total_rows))
# [END bigquery_query_total_rows]

Expand Down Expand Up @@ -551,7 +550,7 @@ def test_query_results_as_dataframe(client):
LIMIT 10
"""

df = client.query(sql).to_dataframe()
df = client.query_and_wait(sql).to_dataframe()
# [END bigquery_query_results_dataframe]
assert isinstance(df, pandas.DataFrame)
assert len(list(df)) == 2 # verify the number of columns
Expand Down