Skip to content

Commit 47433e8

Browse files
committed
docs: fix docstring types
1 parent 29d6c93 commit 47433e8

12 files changed

+43
-40
lines changed

google/cloud/spanner_v1/_helpers.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,19 @@ def _merge_query_options(base, merge):
5353
"""Merge higher precedence QueryOptions with current QueryOptions.
5454
5555
:type base:
56-
:class:`~google.cloud.spanner_v1.ExecuteSqlRequest.QueryOptions`
56+
:class:`~google.cloud.spanner_v1.types.ExecuteSqlRequest.QueryOptions`
5757
or :class:`dict` or None
5858
:param base: The current QueryOptions that is intended for use.
5959
6060
:type merge:
61-
:class:`~google.cloud.spanner_v1.ExecuteSqlRequest.QueryOptions`
61+
:class:`~google.cloud.spanner_v1.types.ExecuteSqlRequest.QueryOptions`
6262
or :class:`dict` or None
6363
:param merge:
6464
The QueryOptions that have a higher priority than base. These options
6565
should overwrite the fields in base.
6666
6767
:rtype:
68-
:class:`~google.cloud.spanner_v1.ExecuteSqlRequest.QueryOptions`
68+
:class:`~google.cloud.spanner_v1.types.ExecuteSqlRequest.QueryOptions`
6969
or None
7070
:returns:
7171
QueryOptions object formed by merging the two given QueryOptions.
@@ -167,7 +167,7 @@ def _parse_value_pb(value_pb, field_type):
167167
:type value_pb: :class:`~google.protobuf.struct_pb2.Value`
168168
:param value_pb: protobuf to convert
169169
170-
:type field_type: :class:`~google.cloud.spanner_v1.Type`
170+
:type field_type: :class:`~google.cloud.spanner_v1.types.Type`
171171
:param field_type: type code for the value
172172
173173
:rtype: varies on field_type
@@ -220,7 +220,7 @@ def _parse_list_value_pbs(rows, row_type):
220220
:type rows: list of :class:`~google.protobuf.struct_pb2.ListValue`
221221
:param rows: row data returned from a read/query
222222
223-
:type row_type: :class:`~google.cloud.spanner_v1.StructType`
223+
:type row_type: :class:`~google.cloud.spanner_v1.types.StructType`
224224
:param row_type: row schema specification
225225
226226
:rtype: list of list of cell data

google/cloud/spanner_v1/backup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def size_bytes(self):
141141
def state(self):
142142
"""State of this backup.
143143
144-
:rtype: :class:`~google.cloud.spanner_admin_database_v1.Backup.State`
144+
:rtype: :class:`~google.cloud.spanner_admin_database_v1.types.Backup.State`
145145
:returns: an enum describing the state of the backup
146146
"""
147147
return self._state
@@ -160,7 +160,7 @@ def referencing_databases(self):
160160
def from_pb(cls, backup_pb, instance):
161161
"""Create an instance of this class from a protobuf message.
162162
163-
:type backup_pb: :class:`~google.spanner.admin.database.v1.Backup`
163+
:type backup_pb: :class:`~google.cloud.spanner_admin_database_v1.types.Backup`
164164
:param backup_pb: A backup protobuf object.
165165
166166
:type instance: :class:`~google.cloud.spanner_v1.instance.Instance`

google/cloud/spanner_v1/batch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def _make_write_pb(table, columns, values):
190190
:type values: list of lists
191191
:param values: Values to be modified.
192192
193-
:rtype: :class:`google.cloud.spanner_v1.Mutation.Write`
193+
:rtype: :class:`google.cloud.spanner_v1.types.Mutation.Write`
194194
:returns: Write protobuf
195195
"""
196196
return Mutation.Write(

google/cloud/spanner_v1/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ class Client(ClientWithProject):
108108
on the client. API Endpoint should be set through client_options.
109109
110110
:type query_options:
111-
:class:`~google.cloud.spanner_v1.ExecuteSqlRequest.QueryOptions`
111+
:class:`~google.cloud.spanner_v1.types.ExecuteSqlRequest.QueryOptions`
112112
or :class:`dict`
113113
:param query_options:
114114
(Optional) Query optimizer configuration to use for the given query.
115115
If a dict is provided, it must be of the same form as the protobuf
116-
message :class:`~google.cloud.spanner_v1.QueryOptions`
116+
message :class:`~google.cloud.spanner_v1.types.QueryOptions`
117117
118118
:raises: :class:`ValueError <exceptions.ValueError>` if both ``read_only``
119119
and ``admin`` are :data:`True`
@@ -348,7 +348,7 @@ def list_instances(self, filter_="", page_size=None):
348348
349349
:rtype: :class:`~google.api_core.page_iterator.Iterator`
350350
:returns:
351-
Iterator of :class:`~google.cloud.spanner_v1.instance.Instance`
351+
Iterator of :class:`~google.cloud.spanner_admin_instance_v1.types.Instance`
352352
resources within the client's project.
353353
"""
354354
metadata = _metadata_with_prefix(self.project_name)

google/cloud/spanner_v1/database.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def from_pb(cls, database_pb, instance, pool=None):
138138
"""Creates an instance of this class from a protobuf.
139139
140140
:type database_pb:
141-
:class:`~google.cloud.spanner_admin_instance_v1.Instance`
141+
:class:`~google.cloud.spanner_admin_instance_v1.types.Instance`
142142
:param database_pb: A instance protobuf object.
143143
144144
:type instance: :class:`~google.cloud.spanner_v1.instance.Instance`
@@ -199,7 +199,7 @@ def name(self):
199199
def state(self):
200200
"""State of this database.
201201
202-
:rtype: :class:`~google.cloud.spanner_admin_database_v1.Database.State`
202+
:rtype: :class:`~google.cloud.spanner_admin_database_v1.types.Database.State`
203203
:returns: an enum describing the state of the database
204204
"""
205205
return self._state
@@ -218,7 +218,7 @@ def create_time(self):
218218
def restore_info(self):
219219
"""Restore info for this database.
220220
221-
:rtype: :class:`~google.cloud.spanner_v1.database.RestoreInfo`
221+
:rtype: :class:`~google.cloud.spanner_v1.types.RestoreInfo`
222222
:returns: an object representing the restore info for this database
223223
"""
224224
return self._restore_info
@@ -429,12 +429,12 @@ def execute_partitioned_dml(
429429
required if parameters are passed.
430430
431431
:type query_options:
432-
:class:`~google.cloud.spanner_v1.ExecuteSqlRequest.QueryOptions`
432+
:class:`~google.cloud.spanner_v1.types.ExecuteSqlRequest.QueryOptions`
433433
or :class:`dict`
434434
:param query_options:
435435
(Optional) Query optimizer configuration to use for the given query.
436436
If a dict is provided, it must be of the same form as the protobuf
437-
message :class:`~google.cloud.spanner_v1.QueryOptions`
437+
message :class:`~google.cloud.spanner_v1.types.QueryOptions`
438438
439439
:rtype: int
440440
:returns: Count of rows affected by the DML statement.
@@ -976,12 +976,12 @@ def generate_query_batches(
976976
differ.
977977
978978
:type query_options:
979-
:class:`~google.cloud.spanner_v1.ExecuteSqlRequest.QueryOptions`
979+
:class:`~google.cloud.spanner_v1.types.ExecuteSqlRequest.QueryOptions`
980980
or :class:`dict`
981981
:param query_options:
982982
(Optional) Query optimizer configuration to use for the given query.
983983
If a dict is provided, it must be of the same form as the protobuf
984-
message :class:`~google.cloud.spanner_v1.QueryOptions`
984+
message :class:`~google.cloud.spanner_v1.types.QueryOptions`
985985
986986
:rtype: iterable of dict
987987
:returns:

google/cloud/spanner_v1/instance.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ def list_databases(self, page_size=None):
398398
399399
:rtype: :class:`~google.api._ore.page_iterator.Iterator`
400400
:returns:
401-
Iterator of :class:`~google.cloud.spanner_v1.database.Database`
401+
Iterator of :class:`~google.cloud.spanner_admin_database_v1.types.Database`
402402
resources within the current instance.
403403
"""
404404
metadata = _metadata_with_prefix(self.name)
@@ -429,6 +429,9 @@ def backup(self, backup_id, database="", expire_time=None, version_time=None):
429429
Optional. The version time that will be used to create the externally
430430
consistent copy of the database. If not present, it is the same as
431431
the `create_time` of the backup.
432+
433+
:rtype: :class:`~google.cloud.spanner_v1.backup.Backup`
434+
:returns: a backup owned by this instance.
432435
"""
433436
try:
434437
return Backup(
@@ -462,7 +465,7 @@ def list_backups(self, filter_="", page_size=None):
462465
463466
:rtype: :class:`~google.api_core.page_iterator.Iterator`
464467
:returns:
465-
Iterator of :class:`~google.cloud.spanner_v1.backup.Backup`
468+
Iterator of :class:`~google.cloud.spanner_admin_database_v1.types.Backup`
466469
resources within the current instance.
467470
"""
468471
metadata = _metadata_with_prefix(self.name)

google/cloud/spanner_v1/keyset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def __init__(
6868
def _to_pb(self):
6969
"""Construct a KeyRange protobuf.
7070
71-
:rtype: :class:`~google.cloud.spanner_v1.KeyRange`
71+
:rtype: :class:`~google.cloud.spanner_v1.types.KeyRange`
7272
:returns: protobuf corresponding to this instance.
7373
"""
7474
kwargs = {}
@@ -139,7 +139,7 @@ def __init__(self, keys=(), ranges=(), all_=False):
139139
def _to_pb(self):
140140
"""Construct a KeySet protobuf.
141141
142-
:rtype: :class:`~google.cloud.spanner_v1.KeySet`
142+
:rtype: :class:`~google.cloud.spanner_v1.types.KeySet`
143143
:returns: protobuf corresponding to this instance.
144144
"""
145145
if self.all_:

google/cloud/spanner_v1/param_types.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333
def Array(element_type): # pylint: disable=invalid-name
3434
"""Construct an array parameter type description protobuf.
3535
36-
:type element_type: :class:`~google.cloud.spanner_v1.Type`
36+
:type element_type: :class:`~google.cloud.spanner_v1.types.Type`
3737
:param element_type: the type of elements of the array
3838
39-
:rtype: :class:`google.cloud.spanner_v1.Type`
39+
:rtype: :class:`google.cloud.spanner_v1.types.Type`
4040
:returns: the appropriate array-type protobuf
4141
"""
4242
return Type(code=TypeCode.ARRAY, array_element_type=element_type)
@@ -48,10 +48,10 @@ def StructField(name, field_type): # pylint: disable=invalid-name
4848
:type name: str
4949
:param name: the name of the field
5050
51-
:type field_type: :class:`google.cloud.spanner_v1.Type`
51+
:type field_type: :class:`google.cloud.spanner_v1.types.Type`
5252
:param field_type: the type of the field
5353
54-
:rtype: :class:`google.cloud.spanner_v1.StructType.Field`
54+
:rtype: :class:`google.cloud.spanner_v1.types.StructType.Field`
5555
:returns: the appropriate struct-field-type protobuf
5656
"""
5757
return StructType.Field(name=name, type_=field_type)
@@ -60,7 +60,7 @@ def StructField(name, field_type): # pylint: disable=invalid-name
6060
def Struct(fields): # pylint: disable=invalid-name
6161
"""Construct a struct parameter type description protobuf.
6262
63-
:type fields: list of :class:`google.cloud.spanner_v1.StructType.Field`
63+
:type fields: list of :class:`google.cloud.spanner_v1.types.StructType.Field`
6464
:param fields: the fields of the struct
6565
6666
:rtype: :class:`type_pb2.Type`

google/cloud/spanner_v1/session.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,18 +243,18 @@ def execute_sql(
243243
the names used in ``sql``.
244244
245245
:type param_types:
246-
dict, {str -> :class:`~google.spanner.v1.type_pb2.TypeCode`}
246+
dict, {str -> :class:`~google.spanner.v1.types.TypeCode`}
247247
:param param_types: (Optional) explicit types for one or more param
248248
values; overrides default type detection on the
249249
back-end.
250250
251251
:type query_mode:
252-
:class:`~google.spanner.v1.spanner_pb2.ExecuteSqlRequest.QueryMode`
252+
:class:`~google.spanner.v1.types.ExecuteSqlRequest.QueryMode`
253253
:param query_mode: Mode governing return of results / query plan. See:
254254
`QueryMode <https://cloud.google.com/spanner/reference/rpc/google.spanner.v1#google.spanner.v1.ExecuteSqlRequest.QueryMode>`_.
255255
256256
:type query_options:
257-
:class:`~google.cloud.spanner_v1.ExecuteSqlRequest.QueryOptions`
257+
:class:`~google.cloud.spanner_v1.types.ExecuteSqlRequest.QueryOptions`
258258
or :class:`dict`
259259
:param query_options: (Optional) Options that are provided for query plan stability.
260260

google/cloud/spanner_v1/snapshot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,18 +204,18 @@ def execute_sql(
204204
required if parameters are passed.
205205
206206
:type query_mode:
207-
:class:`~google.cloud.spanner_v1.ExecuteSqlRequest.QueryMode`
207+
:class:`~google.cloud.spanner_v1.types.ExecuteSqlRequest.QueryMode`
208208
:param query_mode: Mode governing return of results / query plan.
209209
See:
210210
`QueryMode <https://cloud.google.com/spanner/reference/rpc/google.spanner.v1#google.spanner.v1.ExecuteSqlRequest.QueryMode>`_.
211211
212212
:type query_options:
213-
:class:`~google.cloud.spanner_v1.ExecuteSqlRequest.QueryOptions`
213+
:class:`~google.cloud.spanner_v1.types.ExecuteSqlRequest.QueryOptions`
214214
or :class:`dict`
215215
:param query_options:
216216
(Optional) Query optimizer configuration to use for the given query.
217217
If a dict is provided, it must be of the same form as the protobuf
218-
message :class:`~google.cloud.spanner_v1.QueryOptions`
218+
message :class:`~google.cloud.spanner_v1.types.QueryOptions`
219219
220220
:type partition: bytes
221221
:param partition: (Optional) one of the partition tokens returned

google/cloud/spanner_v1/streamed.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class StreamedResultSet(object):
3333
:type response_iterator:
3434
:param response_iterator:
3535
Iterator yielding
36-
:class:`~google.cloud.spanner_v1.PartialResultSet`
36+
:class:`~google.cloud.spanner_v1.types.PartialResultSet`
3737
instances.
3838
3939
:type source: :class:`~google.cloud.spanner_v1.snapshot.Snapshot`
@@ -53,7 +53,7 @@ def __init__(self, response_iterator, source=None):
5353
def fields(self):
5454
"""Field descriptors for result set columns.
5555
56-
:rtype: list of :class:`~google.cloud.spanner_v1.StructType.Field`
56+
:rtype: list of :class:`~google.cloud.spanner_v1.types.StructType.Field`
5757
:returns: list of fields describing column names / types.
5858
"""
5959
return self._metadata.row_type.fields
@@ -62,7 +62,7 @@ def fields(self):
6262
def metadata(self):
6363
"""Result set metadata
6464
65-
:rtype: :class:`~google.cloud.spanner_v1.ResultSetMetadata`
65+
:rtype: :class:`~google.cloud.spanner_v1.types.ResultSetMetadata`
6666
:returns: structure describing the results
6767
"""
6868
return self._metadata
@@ -72,7 +72,7 @@ def stats(self):
7272
"""Result set statistics
7373
7474
:rtype:
75-
:class:`~google.cloud.spanner_v1.ResultSetStats`
75+
:class:`~google.cloud.spanner_v1.types.ResultSetStats`
7676
:returns: structure describing status about the response
7777
"""
7878
return self._stats
@@ -201,7 +201,7 @@ class Unmergeable(ValueError):
201201
:type rhs: :class:`~google.protobuf.struct_pb2.Value`
202202
:param rhs: remaining value to be merged
203203
204-
:type type_: :class:`~google.cloud.spanner_v1.Type`
204+
:type type_: :class:`~google.cloud.spanner_v1.types.Type`
205205
:param type_: field type of values being merged
206206
"""
207207

google/cloud/spanner_v1/transaction.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,13 @@ def execute_update(
202202
required if parameters are passed.
203203
204204
:type query_mode:
205-
:class:`~google.cloud.spanner_v1.ExecuteSqlRequest.QueryMode`
205+
:class:`~google.cloud.spanner_v1.types.ExecuteSqlRequest.QueryMode`
206206
:param query_mode: Mode governing return of results / query plan.
207207
See:
208208
`QueryMode <https://cloud.google.com/spanner/reference/rpc/google.spanner.v1#google.spanner.v1.ExecuteSqlRequest.QueryMode>`_.
209209
210210
:type query_options:
211-
:class:`~google.cloud.spanner_v1.ExecuteSqlRequest.QueryOptions`
211+
:class:`~google.cloud.spanner_v1.types.ExecuteSqlRequest.QueryOptions`
212212
or :class:`dict`
213213
:param query_options: (Optional) Options that are provided for query plan stability.
214214

0 commit comments

Comments
 (0)