Skip to content

Commit a4d9534

Browse files
authored
docs: render fields correctly for update calls (#2055)
1 parent 53c289e commit a4d9534

File tree

1 file changed

+41
-41
lines changed

1 file changed

+41
-41
lines changed

google/cloud/bigquery/client.py

+41-41
Original file line numberDiff line numberDiff line change
@@ -1184,6 +1184,19 @@ def update_dataset(
11841184
must be provided. If a field is listed in ``fields`` and is ``None`` in
11851185
``dataset``, it will be deleted.
11861186
1187+
For example, to update the default expiration times, specify
1188+
both properties in the ``fields`` argument:
1189+
1190+
.. code-block:: python
1191+
1192+
bigquery_client.update_dataset(
1193+
dataset,
1194+
[
1195+
"default_partition_expiration_ms",
1196+
"default_table_expiration_ms",
1197+
]
1198+
)
1199+
11871200
If ``dataset.etag`` is not ``None``, the update will only
11881201
succeed if the dataset on the server has the same ETag. Thus
11891202
reading a dataset with ``get_dataset``, changing its fields,
@@ -1198,19 +1211,6 @@ def update_dataset(
11981211
The properties of ``dataset`` to change. These are strings
11991212
corresponding to the properties of
12001213
:class:`~google.cloud.bigquery.dataset.Dataset`.
1201-
1202-
For example, to update the default expiration times, specify
1203-
both properties in the ``fields`` argument:
1204-
1205-
.. code-block:: python
1206-
1207-
bigquery_client.update_dataset(
1208-
dataset,
1209-
[
1210-
"default_partition_expiration_ms",
1211-
"default_table_expiration_ms",
1212-
]
1213-
)
12141214
retry (Optional[google.api_core.retry.Retry]):
12151215
How to retry the RPC.
12161216
timeout (Optional[float]):
@@ -1254,6 +1254,15 @@ def update_model(
12541254
must be provided. If a field is listed in ``fields`` and is ``None``
12551255
in ``model``, the field value will be deleted.
12561256
1257+
For example, to update the descriptive properties of the model,
1258+
specify them in the ``fields`` argument:
1259+
1260+
.. code-block:: python
1261+
1262+
bigquery_client.update_model(
1263+
model, ["description", "friendly_name"]
1264+
)
1265+
12571266
If ``model.etag`` is not ``None``, the update will only succeed if
12581267
the model on the server has the same ETag. Thus reading a model with
12591268
``get_model``, changing its fields, and then passing it to
@@ -1266,15 +1275,6 @@ def update_model(
12661275
The properties of ``model`` to change. These are strings
12671276
corresponding to the properties of
12681277
:class:`~google.cloud.bigquery.model.Model`.
1269-
1270-
For example, to update the descriptive properties of the model,
1271-
specify them in the ``fields`` argument:
1272-
1273-
.. code-block:: python
1274-
1275-
bigquery_client.update_model(
1276-
model, ["description", "friendly_name"]
1277-
)
12781278
retry (Optional[google.api_core.retry.Retry]):
12791279
A description of how to retry the API call.
12801280
timeout (Optional[float]):
@@ -1318,6 +1318,15 @@ def update_routine(
13181318
must be provided. If a field is listed in ``fields`` and is ``None``
13191319
in ``routine``, the field value will be deleted.
13201320
1321+
For example, to update the description property of the routine,
1322+
specify it in the ``fields`` argument:
1323+
1324+
.. code-block:: python
1325+
1326+
bigquery_client.update_routine(
1327+
routine, ["description"]
1328+
)
1329+
13211330
.. warning::
13221331
During beta, partial updates are not supported. You must provide
13231332
all fields in the resource.
@@ -1336,15 +1345,6 @@ def update_routine(
13361345
fields (Sequence[str]):
13371346
The fields of ``routine`` to change, spelled as the
13381347
:class:`~google.cloud.bigquery.routine.Routine` properties.
1339-
1340-
For example, to update the description property of the routine,
1341-
specify it in the ``fields`` argument:
1342-
1343-
.. code-block:: python
1344-
1345-
bigquery_client.update_routine(
1346-
routine, ["description"]
1347-
)
13481348
retry (Optional[google.api_core.retry.Retry]):
13491349
A description of how to retry the API call.
13501350
timeout (Optional[float]):
@@ -1392,6 +1392,16 @@ def update_table(
13921392
must be provided. If a field is listed in ``fields`` and is ``None``
13931393
in ``table``, the field value will be deleted.
13941394
1395+
For example, to update the descriptive properties of the table,
1396+
specify them in the ``fields`` argument:
1397+
1398+
.. code-block:: python
1399+
1400+
bigquery_client.update_table(
1401+
table,
1402+
["description", "friendly_name"]
1403+
)
1404+
13951405
If ``table.etag`` is not ``None``, the update will only succeed if
13961406
the table on the server has the same ETag. Thus reading a table with
13971407
``get_table``, changing its fields, and then passing it to
@@ -1403,16 +1413,6 @@ def update_table(
14031413
fields (Sequence[str]):
14041414
The fields of ``table`` to change, spelled as the
14051415
:class:`~google.cloud.bigquery.table.Table` properties.
1406-
1407-
For example, to update the descriptive properties of the table,
1408-
specify them in the ``fields`` argument:
1409-
1410-
.. code-block:: python
1411-
1412-
bigquery_client.update_table(
1413-
table,
1414-
["description", "friendly_name"]
1415-
)
14161416
retry (Optional[google.api_core.retry.Retry]):
14171417
A description of how to retry the API call.
14181418
timeout (Optional[float]):

0 commit comments

Comments
 (0)