Skip to content

Commit 24f3910

Browse files
authored
docs: use timeout in create dataset sample (#52)
* docs: use timeout in create dataset sample * Emphasize "explicit" in comment timeout
1 parent 400673b commit 24f3910

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

samples/create_dataset.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ def create_dataset(dataset_id):
3030
# TODO(developer): Specify the geographic location where the dataset should reside.
3131
dataset.location = "US"
3232

33-
# Send the dataset to the API for creation.
33+
# Send the dataset to the API for creation, with an explicit timeout.
3434
# Raises google.api_core.exceptions.Conflict if the Dataset already
3535
# exists within the project.
36-
dataset = client.create_dataset(dataset) # Make an API request.
36+
dataset = client.create_dataset(dataset, timeout=30) # Make an API request.
3737
print("Created dataset {}.{}".format(client.project, dataset.dataset_id))
3838
# [END bigquery_create_dataset]

0 commit comments

Comments
 (0)