Skip to content

Commit

Permalink
Pass location where auto-detection not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
plamut authored and emar-kar committed Oct 25, 2019
1 parent 0e50ead commit 04555f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion bigquery/samples/client_query_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ def client_query_batch(client):

# Check on the progress by getting the job's updated state. Once the state
# is `DONE`, the results are ready.
query_job = client.get_job(query_job.job_id) # Make an API request.
query_job = client.get_job(
query_job.job_id, location=query_job.location
) # Make an API request.

print("Job {} is currently in state {}".format(query_job.job_id, query_job.state))
# [END bigquery_query_batch]
Expand Down
2 changes: 1 addition & 1 deletion bigquery/samples/tests/test_create_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
def test_create_job(capsys, client):

query_job = create_job.create_job(client)
client.cancel_job(query_job.job_id)
client.cancel_job(query_job.job_id, location=query_job.location)
out, err = capsys.readouterr()
assert "Started job: {}".format(query_job.job_id) in out

0 comments on commit 04555f9

Please sign in to comment.