Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8c7e02b

Browse files
authored
docs: add examples offields argument to update methods (#418)
1 parente68281e commit8c7e02b

File tree

1 file changed

+52
-8
lines changed

1 file changed

+52
-8
lines changed

‎google/cloud/bigquery/client.py‎

Lines changed: 52 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,22 @@ def update_dataset(self, dataset, fields, retry=DEFAULT_RETRY, timeout=None):
881881
dataset (google.cloud.bigquery.dataset.Dataset):
882882
The dataset to update.
883883
fields (Sequence[str]):
884-
The properties of ``dataset`` to change (e.g. "friendly_name").
884+
The properties of ``dataset`` to change. These are strings
885+
corresponding to the properties of
886+
:class:`~google.cloud.bigquery.dataset.Dataset`.
887+
888+
For example, to update the default expiration times, specify
889+
both properties in the ``fields`` argument:
890+
891+
.. code-block:: python
892+
893+
bigquery_client.update_dataset(
894+
dataset,
895+
[
896+
"default_partition_expiration_ms",
897+
"default_table_expiration_ms",
898+
]
899+
)
885900
retry (Optional[google.api_core.retry.Retry]):
886901
How to retry the RPC.
887902
timeout (Optional[float]):
@@ -928,8 +943,18 @@ def update_model(self, model, fields, retry=DEFAULT_RETRY, timeout=None):
928943
Args:
929944
model (google.cloud.bigquery.model.Model): The model to update.
930945
fields (Sequence[str]):
931-
The fields of ``model`` to change, spelled as the Model
932-
properties (e.g. "friendly_name").
946+
The properties of ``model`` to change. These are strings
947+
corresponding to the properties of
948+
:class:`~google.cloud.bigquery.model.Model`.
949+
950+
For example, to update the descriptive properties of the model,
951+
specify them in the ``fields`` argument:
952+
953+
.. code-block:: python
954+
955+
bigquery_client.update_model(
956+
model, ["description", "friendly_name"]
957+
)
933958
retry (Optional[google.api_core.retry.Retry]):
934959
A description of how to retry the API call.
935960
timeout (Optional[float]):
@@ -980,11 +1005,20 @@ def update_routine(self, routine, fields, retry=DEFAULT_RETRY, timeout=None):
9801005
occurred since the read.
9811006
9821007
Args:
983-
routine (google.cloud.bigquery.routine.Routine): The routine to update.
1008+
routine (google.cloud.bigquery.routine.Routine):
1009+
The routine to update.
9841010
fields (Sequence[str]):
9851011
The fields of ``routine`` to change, spelled as the
986-
:class:`~google.cloud.bigquery.routine.Routine` properties
987-
(e.g. ``type_``).
1012+
:class:`~google.cloud.bigquery.routine.Routine` properties.
1013+
1014+
For example, to update the description property of the routine,
1015+
specify it in the ``fields`` argument:
1016+
1017+
.. code-block:: python
1018+
1019+
bigquery_client.update_routine(
1020+
routine, ["description"]
1021+
)
9881022
retry (Optional[google.api_core.retry.Retry]):
9891023
A description of how to retry the API call.
9901024
timeout (Optional[float]):
@@ -1035,8 +1069,18 @@ def update_table(self, table, fields, retry=DEFAULT_RETRY, timeout=None):
10351069
Args:
10361070
table (google.cloud.bigquery.table.Table): The table to update.
10371071
fields (Sequence[str]):
1038-
The fields of ``table`` to change, spelled as the Table
1039-
properties (e.g. "friendly_name").
1072+
The fields of ``table`` to change, spelled as the
1073+
:class:`~google.cloud.bigquery.table.Table` properties.
1074+
1075+
For example, to update the descriptive properties of the table,
1076+
specify them in the ``fields`` argument:
1077+
1078+
.. code-block:: python
1079+
1080+
bigquery_client.update_table(
1081+
table,
1082+
["description", "friendly_name"]
1083+
)
10401084
retry (Optional[google.api_core.retry.Retry]):
10411085
A description of how to retry the API call.
10421086
timeout (Optional[float]):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp