Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
6b3a2a3
Merge pull request #26 from googleapis/master
mf2199 Aug 9, 2019
4c6d7b4
Move every snippet to it's own file. Create test templates.
Aug 9, 2019
377310c
list_datasets_by_label
emar-kar Aug 9, 2019
5ce976f
Merge remote-tracking branch 'upstream/master'
emar-kar Aug 12, 2019
a7b2376
manage_dataset_labels
emar-kar Aug 12, 2019
0de5d8b
add_empty_column
emar-kar Aug 12, 2019
5e05cd8
browse_table_data
emar-kar Aug 12, 2019
f6b60a0
dataset_exists
emar-kar Aug 12, 2019
a773251
complete change of dataset_exists
emar-kar Aug 12, 2019
8375877
Merge remote-tracking branch 'upstream/master'
emar-kar Aug 13, 2019
a0792bd
five updated snippets
emar-kar Aug 13, 2019
95dc8f8
Update datasets.rst
emar-kar Aug 13, 2019
cf7576e
cosmetic chgs
emar-kar Aug 13, 2019
0645e33
client_list_jobs
emar-kar Aug 13, 2019
92efd59
client_query
emar-kar Aug 13, 2019
1814821
copy_table
emar-kar Aug 13, 2019
a31bc1f
cosmetic chgs
emar-kar Aug 13, 2019
725c515
Update datasets.rst
emar-kar Aug 13, 2019
6ffc123
cosmetic chgs
emar-kar Aug 13, 2019
5654dcd
cosmetic chgs
emar-kar Aug 13, 2019
2ff376c
table_exists
emar-kar Aug 13, 2019
948ddb5
Update test_copy_table.py
emar-kar Aug 13, 2019
e8d62c4
Update test_table_exists.py
emar-kar Aug 13, 2019
28251ec
Update snippets.py
emar-kar Aug 13, 2019
ad623ba
update client_list_jobs
emar-kar Aug 14, 2019
ec67aee
table_insert_rows
emar-kar Aug 14, 2019
c8c0f70
Update client_query.py
emar-kar Aug 14, 2019
42204ed
Merge remote-tracking branch 'upstream/master'
emar-kar Aug 14, 2019
b4dade6
Merge commit '2d622fd2de8654c0e82a53f709bd377ab3e0a1ff' into snippets…
emar-kar Aug 14, 2019
febfa11
update client_query
emar-kar Aug 14, 2019
c66ba4b
five updated snippets
emar-kar Aug 14, 2019
0e7ccf5
*.rst files correction
emar-kar Aug 14, 2019
d5ab15d
Update tables.rst
emar-kar Aug 14, 2019
7704ad3
update copy_table
emar-kar Aug 14, 2019
6dd1174
update first-five
emar-kar Aug 14, 2019
50c4aed
update second-five
emar-kar Aug 14, 2019
7a654c3
Update test_dataset_exists.py
emar-kar Aug 14, 2019
8e26115
update imports
emar-kar Aug 14, 2019
0cf0071
update list_datasets_by_label
emar-kar Aug 14, 2019
f602e3f
Update test_browse_table_data.py
emar-kar Aug 15, 2019
0bf9aab
The update of the first-five according to the requested chgs
emar-kar Aug 15, 2019
2e50a81
snippets file reformatted
emar-kar Aug 15, 2019
9e77624
Update tables.rst
emar-kar Aug 16, 2019
7d99673
update_client_query
emar-kar Aug 19, 2019
e37f5a2
update manage_dataset_labels
emar-kar Aug 23, 2019
af27c29
update browse_table_data
emar-kar Aug 23, 2019
47ee156
deleted extra spaces
emar-kar Aug 23, 2019
b78f6c9
update import settings
emar-kar Aug 23, 2019
6ee351e
reformate samples/
emar-kar Aug 23, 2019
9a65dae
general update second five
emar-kar Aug 23, 2019
0913f6a
five updated snippets
emar-kar Aug 23, 2019
14757f6
minor update
emar-kar Aug 26, 2019
9941957
cosmetic chgs
emar-kar Aug 26, 2019
4ca71e5
Merge branch 'first-five' into second-five-v2
emar-kar Aug 26, 2019
cd78ed2
Merge branch 'master' into second-five-v2
emar-kar Aug 26, 2019
9cc5661
Merge branch 'master' into first-five
emar-kar Aug 26, 2019
7e42411
Merge branch 'first-five' into second-five-v2
emar-kar Aug 26, 2019
056f357
Update tables.rst
emar-kar Aug 26, 2019
70c032f
Update test_list_datasets_by_label.py
emar-kar Aug 26, 2019
cde3e62
update delete_dataset_labels
emar-kar Aug 27, 2019
9d3c1aa
Update test_dataset_label_samples.py
emar-kar Aug 27, 2019
99a5bd5
Merge branch 'first-five' into second-five-v2
emar-kar Aug 28, 2019
2ba305b
Merge branch 'master' into second-five-v2
emar-kar Aug 28, 2019
f3607c1
Update conftest.py
emar-kar Aug 28, 2019
1040fba
update test files
emar-kar Aug 28, 2019
edac824
cosmetic chgs
emar-kar Aug 28, 2019
ea94915
Update test_client_list_jobs.py
emar-kar Aug 29, 2019
92fca34
Update test_table_exists.py
emar-kar Aug 29, 2019
17fb644
cosmetic chgs
emar-kar Aug 29, 2019
2dfcc3d
Update test_client_list_jobs.py
emar-kar Aug 29, 2019
c4e3f7c
Merge branch 'master' into second-five-v2
emar-kar Aug 30, 2019
902fdd9
cosmetic chgs
emar-kar Aug 30, 2019
2483f55
Merge branch 'master' into second-five-v2
emar-kar Sep 2, 2019
df4f6c1
Merge branch 'master' into second-five-v2
emar-kar Sep 3, 2019
ccf3dcd
update client_list_jobs
emar-kar Sep 3, 2019
b87e7d0
Merge branch 'master' into second-five-v2
emar-kar Sep 4, 2019
150bcf2
cosmetic update
emar-kar Sep 11, 2019
ab504bf
comments rephrasing
emar-kar Sep 25, 2019
176395e
Merge branch 'master' into second-five-v2
emar-kar Sep 27, 2019
e67d172
updated as requested
emar-kar Sep 27, 2019
da4a2bc
comment lines update
emar-kar Sep 27, 2019
8852951
lint fix
emar-kar Oct 8, 2019
6d533b3
comments update
emar-kar Oct 8, 2019
327373c
Merge branch 'master' into second-five-v2
emar-kar Oct 8, 2019
e55f698
Update update_dataset_access.py
emar-kar Oct 8, 2019
ef884b8
revert commit with -s
emar-kar Oct 9, 2019
50394cd
delete -s from comment lines
emar-kar Oct 11, 2019
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
Prev Previous commit
Next Next commit
comments update
  • Loading branch information
emar-kar committed Oct 8, 2019
commit 6d533b30b9800ef85411a78b8e6f16c8a69b5435
4 changes: 2 additions & 2 deletions bigquery/samples/add_empty_column.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ def add_empty_column(client, table_id):
# to add an empty column.
# table_id = "your-project.your_dataset.your_table_name"

table = client.get_table(table_id) # Make an API request.
table = client.get_table(table_id) # Makes an API request.

original_schema = table.schema
new_schema = original_schema[:] # Creates a copy of the schema.
new_schema.append(bigquery.SchemaField("phone", "STRING"))

table.schema = new_schema
table = client.update_table(table, ["schema"]) # Make an API request.
table = client.update_table(table, ["schema"]) # Makes an API request.

if len(table.schema) == len(original_schema) + 1 == len(new_schema):
print("A new column has been added.")
Expand Down
4 changes: 2 additions & 2 deletions bigquery/samples/browse_table_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def browse_table_data(client, table_id):
# table_id = "your-project.your_dataset.your_table_name"

# Download all rows from a table.
rows_iter = client.list_rows(table_id) # Make an API request.
rows_iter = client.list_rows(table_id) # Makes an API request.

# Iterate over rows to make the API requests to fetch row data.
rows = list(rows_iter)
Expand All @@ -38,7 +38,7 @@ def browse_table_data(client, table_id):
print("Downloaded {} rows from table {}".format(len(rows), table_id))

# Specify selected fields to limit the results to certain columns.
table = client.get_table(table_id) # Make an API request.
table = client.get_table(table_id) # Makes an API request.
fields = table.schema[:2] # First two columns.
rows_iter = client.list_rows(table_id, selected_fields=fields, max_results=10)
rows = list(rows_iter)
Expand Down
2 changes: 1 addition & 1 deletion bigquery/samples/client_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def client_query(client):
"""
query_job = client.query(
query, location="US" # Must match the destination dataset(s) location.
) # Make an API request.
) # Makes an API request.

print("The query data:")
for row in query_job:
Expand Down
2 changes: 1 addition & 1 deletion bigquery/samples/create_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ def create_dataset(client, dataset_id):
# Send the dataset to the API for creation.
# Raises google.api_core.exceptions.Conflict if the Dataset already
# exists within the project.
dataset = client.create_dataset(dataset) # Make an API request.
dataset = client.create_dataset(dataset) # Makes an API request.
print("Created dataset {}.{}".format(client.project, dataset.dataset_id))
# [END bigquery_create_dataset]
2 changes: 1 addition & 1 deletion bigquery/samples/create_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def create_job(client):
# The client libraries automatically generate a job ID. Override the
# generated ID with either the job_id_prefix or job_id parameters.
job_id_prefix="code_sample_",
) # Make an API request.
) # Makes an API request.

print("Started job: {}".format(query_job.job_id))
# [END bigquery_create_job]
Expand Down
2 changes: 1 addition & 1 deletion bigquery/samples/create_routine.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def create_routine(client, routine_id):
],
)

routine = client.create_routine(routine) # Make an API request.
routine = client.create_routine(routine) # Makes an API request.

print("Created routine {}".format(routine.reference))
# [END bigquery_create_routine]
Expand Down
2 changes: 1 addition & 1 deletion bigquery/samples/create_routine_ddl.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def create_routine_ddl(client, routine_id):
""".format(
routine_id
)
query_job = client.query(sql) # Make an API request.
query_job = client.query(sql) # Makes an API request.
query_job.result() # Waits for the job to complete.

print("Created routine {}".format(query_job.ddl_target_routine))
Expand Down
2 changes: 1 addition & 1 deletion bigquery/samples/create_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def create_table(client, table_id):
]

table = bigquery.Table(table_id, schema=schema)
table = client.create_table(table) # Make an API request.
table = client.create_table(table) # Makes an API request.
print(
"Created table {}.{}.{}".format(table.project, table.dataset_id, table.table_id)
)
Expand Down
2 changes: 1 addition & 1 deletion bigquery/samples/dataset_exists.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def dataset_exists(client, dataset_id):
# dataset_id = "your-project.your_dataset"

try:
client.get_dataset(dataset_id) # Make an API request.
client.get_dataset(dataset_id) # Makes an API request.
print("Dataset {} already exists".format(dataset_id))
except NotFound:
print("Dataset {} is not found".format(dataset_id))
Expand Down
2 changes: 1 addition & 1 deletion bigquery/samples/delete_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def delete_dataset(client, dataset_id):
# Use the not_found_ok parameter to not receive an error if the dataset has already been deleted.
client.delete_dataset(
dataset_id, delete_contents=True, not_found_ok=True
) # Make an API request.
) # Makes an API request.

print("Deleted dataset '{}'.".format(dataset_id))
# [END bigquery_delete_dataset]
4 changes: 2 additions & 2 deletions bigquery/samples/delete_dataset_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ def delete_dataset_labels(client, dataset_id):
# TODO(developer): Set dataset_id to the ID of the dataset to fetch.
# dataset_id = "your-project.your_dataset"

dataset = client.get_dataset(dataset_id) # Make an API request.
dataset = client.get_dataset(dataset_id) # Makes an API request.

# To delete a label from a dataset, set its value to None.
dataset.labels["color"] = None

dataset = client.update_dataset(dataset, ["labels"]) # Make an API request.
dataset = client.update_dataset(dataset, ["labels"]) # Makes an API request.
print("Labels deleted from {}".format(dataset_id))
# [END bigquery_delete_label_dataset]
return dataset
2 changes: 1 addition & 1 deletion bigquery/samples/delete_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def delete_model(client, model_id):
# TODO(developer): Set model_id to the ID of the model to fetch.
# model_id = 'your-project.your_dataset.your_model'

client.delete_model(model_id) # Make an API request.
client.delete_model(model_id) # Makes an API request.

print("Deleted model '{}'.".format(model_id))
# [END bigquery_delete_model]
2 changes: 1 addition & 1 deletion bigquery/samples/delete_routine.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def delete_routine(client, routine_id):
# TODO(developer): Set the fully-qualified ID for the routine.
# routine_id = "my-project.my_dataset.my_routine"

client.delete_routine(routine_id) # Make an API request.
client.delete_routine(routine_id) # Makes an API request.

print("Deleted routine {}.".format(routine_id))
# [END bigquery_delete_routine]
2 changes: 1 addition & 1 deletion bigquery/samples/delete_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ def delete_table(client, table_id):

# If the table does not exist, delete_table raises
# google.api_core.exceptions.NotFound unless not_found_ok is True.
client.delete_table(table_id, not_found_ok=True) # Make an API request.
client.delete_table(table_id, not_found_ok=True) # Makes an API request.
print("Deleted table '{}'.".format(table_id))
# [END bigquery_delete_table]
2 changes: 1 addition & 1 deletion bigquery/samples/get_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def get_dataset(client, dataset_id):
# TODO(developer): Set dataset_id to the ID of the dataset to fetch.
# dataset_id = 'your-project.your_dataset'

dataset = client.get_dataset(dataset_id) # Make an API request.
dataset = client.get_dataset(dataset_id) # Makes an API request.

full_dataset_id = "{}.{}".format(dataset.project, dataset.dataset_id)
friendly_name = dataset.friendly_name
Expand Down
2 changes: 1 addition & 1 deletion bigquery/samples/get_dataset_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def get_dataset_labels(client, dataset_id):
# TODO(developer): Set dataset_id to the ID of the dataset to fetch.
# dataset_id = "your-project.your_dataset"

dataset = client.get_dataset(dataset_id) # Make an API request.
dataset = client.get_dataset(dataset_id) # Makes an API request.

# View dataset labels.
print("Dataset ID: {}".format(dataset_id))
Expand Down
2 changes: 1 addition & 1 deletion bigquery/samples/get_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def get_model(client, model_id):
# TODO(developer): Set model_id to the ID of the model to fetch.
# model_id = 'your-project.your_dataset.your_model'

model = client.get_model(model_id) # Make an API request.
model = client.get_model(model_id) # Makes an API request.

full_model_id = "{}.{}.{}".format(model.project, model.dataset_id, model.model_id)
friendly_name = model.friendly_name
Expand Down
2 changes: 1 addition & 1 deletion bigquery/samples/get_routine.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def get_routine(client, routine_id):
# TODO(developer): Set the fully-qualified ID for the routine.
# routine_id = "my-project.my_dataset.my_routine"

routine = client.get_routine(routine_id) # Make an API request.
routine = client.get_routine(routine_id) # Makes an API request.

print("Routine '{}':".format(routine.reference))
print("\tType: '{}'".format(routine.type_))
Expand Down
2 changes: 1 addition & 1 deletion bigquery/samples/get_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def get_table(client, table_id):
# TODO(developer): Set table_id to the ID of the model to fetch.
# table_id = 'your-project.your_dataset.your_table'

table = client.get_table(table_id) # Make an API request.
table = client.get_table(table_id) # Makes an API request.

# View table properties
print(
Expand Down
4 changes: 2 additions & 2 deletions bigquery/samples/label_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ def label_dataset(client, dataset_id):
# TODO(developer): Set dataset_id to the ID of the dataset to fetch.
# dataset_id = "your-project.your_dataset"

dataset = client.get_dataset(dataset_id) # Make an API request.
dataset = client.get_dataset(dataset_id) # Makes an API request.
dataset.labels = {"color": "green"}
dataset = client.update_dataset(dataset, ["labels"]) # Make an API request.
dataset = client.update_dataset(dataset, ["labels"]) # Makes an API request.

print("Labels added to {}".format(dataset_id))
# [END bigquery_label_dataset]
2 changes: 1 addition & 1 deletion bigquery/samples/list_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def list_datasets(client):
# TODO(developer): Construct a BigQuery client object.
# client = bigquery.Client()

datasets = list(client.list_datasets()) # Make an API request.
datasets = list(client.list_datasets()) # Makes an API request.
project = client.project

if datasets:
Expand Down
2 changes: 1 addition & 1 deletion bigquery/samples/list_datasets_by_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def list_datasets_by_label(client):
# client = bigquery.Client()

label_filter = "labels.color:green"
datasets = list(client.list_datasets(filter=label_filter)) # Make an API request.
datasets = list(client.list_datasets(filter=label_filter)) # Makes an API request.

if datasets:
print("Datasets filtered by {}:".format(label_filter))
Expand Down
2 changes: 1 addition & 1 deletion bigquery/samples/list_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def list_models(client, dataset_id):
# the models you are listing.
# dataset_id = 'your-project.your_dataset'

models = client.list_models(dataset_id) # Make an API request.
models = client.list_models(dataset_id) # Makes an API request.

print("Models contained in '{}':".format(dataset_id))
for model in models:
Expand Down
2 changes: 1 addition & 1 deletion bigquery/samples/list_routines.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def list_routines(client, dataset_id):
# the routines you are listing.
# dataset_id = 'your-project.your_dataset'

routines = client.list_routines(dataset_id) # Make an API request.
routines = client.list_routines(dataset_id) # Makes an API request.

print("Routines contained in dataset {}:".format(dataset_id))
for routine in routines:
Expand Down
2 changes: 1 addition & 1 deletion bigquery/samples/list_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def list_tables(client, dataset_id):
# the tables you are listing.
# dataset_id = 'your-project.your_dataset'

tables = client.list_tables(dataset_id) # Make an API request.
tables = client.list_tables(dataset_id) # Makes an API request.

print("Tables contained in '{}':".format(dataset_id))
for table in tables:
Expand Down
4 changes: 2 additions & 2 deletions bigquery/samples/load_table_dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ def load_table_dataframe(client, table_id):
table_id,
job_config=job_config,
location="US", # Must match the destination dataset location.
) # Make an API request.
) # Makes an API request.
job.result() # Waits for the job to complete.

table = client.get_table(table_id) # Make an API request.
table = client.get_table(table_id) # Makes an API request.
print(
"Loaded {} rows and {} columns to {}".format(
table.num_rows, len(table.schema), table_id
Expand Down
2 changes: 1 addition & 1 deletion bigquery/samples/query_to_arrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def query_to_arrow(client):
CROSS JOIN UNNEST(r.participants) as participant;
"""
query_job = client.query(sql)
arrow_table = query_job.to_arrow() # Make an API request.
arrow_table = query_job.to_arrow() # Makes an API request.

print(
"Downloaded {} rows, {} columns.".format(
Expand Down
2 changes: 1 addition & 1 deletion bigquery/samples/table_exists.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def table_exists(client, table_id):
# table_id = "your-project.your_dataset.your_table"

try:
client.get_table(table_id) # Make an API request.
client.get_table(table_id) # Makes an API request.
print("Table {} already exists.".format(table_id))
except NotFound:
print("Table {} is not found.".format(table_id))
Expand Down
4 changes: 2 additions & 2 deletions bigquery/samples/table_insert_rows.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ def table_insert_rows(client, table_id):
# TODO(developer): Set table_id to the ID of the model to fetch.
# table_id = "your-project.your_dataset.your_table"

table = client.get_table(table_id) # Make an API request.
table = client.get_table(table_id) # Makes an API request.
rows_to_insert = [(u"Phred Phlyntstone", 32), (u"Wylma Phlyntstone", 29)]

errors = client.insert_rows(table, rows_to_insert) # Make an API request.
errors = client.insert_rows(table, rows_to_insert) # Makes an API request.
if errors == []:
print("New rows have been added.")
# [END bigquery_table_insert_rows]
4 changes: 2 additions & 2 deletions bigquery/samples/update_dataset_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def update_dataset_access(client, dataset_id):
# TODO(developer): Set dataset_id to the ID of the dataset to fetch.
# dataset_id = 'your-project.your_dataset'

dataset = client.get_dataset(dataset_id) # Make an API request.
dataset = client.get_dataset(dataset_id) # Makes an API request.

entry = bigquery.AccessEntry(
role="READER",
Expand All @@ -36,7 +36,7 @@ def update_dataset_access(client, dataset_id):
entries.append(entry)
dataset.access_entries = entries

dataset = client.update_dataset(dataset, ["access_entries"]) # Make an API request.
dataset = client.update_dataset(dataset, ["access_entries"]) # Makes an API request.

full_dataset_id = "{}.{}".format(dataset.project, dataset.dataset_id)
print(
Expand Down
4 changes: 2 additions & 2 deletions bigquery/samples/update_dataset_default_table_expiration.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ def update_dataset_default_table_expiration(client, dataset_id):
# TODO(developer): Set dataset_id to the ID of the dataset to fetch.
# dataset_id = 'your-project.your_dataset'

dataset = client.get_dataset(dataset_id) # Make an API request.
dataset = client.get_dataset(dataset_id) # Makes an API request.
dataset.default_table_expiration_ms = 24 * 60 * 60 * 1000 # In milliseconds.

dataset = client.update_dataset(
dataset, ["default_table_expiration_ms"]
) # Make an API request.
) # Makes an API request.

full_dataset_id = "{}.{}".format(dataset.project, dataset.dataset_id)
print(
Expand Down
4 changes: 2 additions & 2 deletions bigquery/samples/update_dataset_description.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ def update_dataset_description(client, dataset_id):
# TODO(developer): Set dataset_id to the ID of the dataset to fetch.
# dataset_id = 'your-project.your_dataset'

dataset = client.get_dataset(dataset_id) # Make an API request.
dataset = client.get_dataset(dataset_id) # Makes an API request.
dataset.description = "Updated description."
dataset = client.update_dataset(dataset, ["description"]) # Make an API request.
dataset = client.update_dataset(dataset, ["description"]) # Makes an API request.

full_dataset_id = "{}.{}".format(dataset.project, dataset.dataset_id)
print(
Expand Down
4 changes: 2 additions & 2 deletions bigquery/samples/update_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ def update_model(client, model_id):
# TODO(developer): Set model_id to the ID of the model to fetch.
# model_id = 'your-project.your_dataset.your_model'

model = client.get_model(model_id) # Make an API request.
model = client.get_model(model_id) # Makes an API request.
model.description = "This model was modified from a Python program."
model = client.update_model(model, ["description"]) # Make an API request.
model = client.update_model(model, ["description"]) # Makes an API request.

full_model_id = "{}.{}.{}".format(model.project, model.dataset_id, model.model_id)
print(
Expand Down