Skip to content

Commit 2441825

Browse files
authored
Revert "Replace relative class refs with fully-qualifed names. (#8039)" (#8095)
This reverts commit 76e877d.
1 parent 76e877d commit 2441825

20 files changed

+296
-296
lines changed

‎google/cloud/firestore_v1/_helpers.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,11 @@ def reference_value_to_document(reference_value, client):
220220
221221
Args:
222222
reference_value (str): A document reference value.
223-
client (~google.cloud.firestore_v1.client.Client): A client that has
223+
client (~.firestore_v1.client.Client): A client that has
224224
a document factory.
225225
226226
Returns:
227-
~google.cloud.firestore_v1.document.DocumentReference: The document
227+
~.firestore_v1.document.DocumentReference: The document
228228
corresponding to ``reference_value``.
229229
230230
Raises:
@@ -255,7 +255,7 @@ def decode_value(value, client):
255255
Args:
256256
value (google.cloud.firestore_v1.types.Value): A
257257
Firestore protobuf to be decoded / parsed / converted.
258-
client (~google.cloud.firestore_v1.client.Client): A client that has
258+
client (~.firestore_v1.client.Client): A client that has
259259
a document factory.
260260
261261
Returns:
@@ -301,7 +301,7 @@ def decode_dict(value_fields, client):
301301
Args:
302302
value_fields (google.protobuf.pyext._message.MessageMapContainer): A
303303
protobuf map of Firestore ``Value``-s.
304-
client (~google.cloud.firestore_v1.client.Client): A client that has
304+
client (~.firestore_v1.client.Client): A client that has
305305
a document factory.
306306
307307
Returns:
@@ -851,7 +851,7 @@ def pbs_for_update(document_path, field_updates, option):
851851
document_path (str): A fully-qualified document path.
852852
field_updates (dict): Field names or paths to update and values
853853
to update with.
854-
option (optional[~google.cloud.firestore_v1.client.WriteOption]): A
854+
option (optional[~.firestore_v1.client.WriteOption]): A
855855
write option to make assertions / preconditions on the server
856856
state of the document before applying changes.
857857
@@ -890,7 +890,7 @@ def pb_for_delete(document_path, option):
890890
891891
Args:
892892
document_path (str): A fully-qualified document path.
893-
option (optional[~google.cloud.firestore_v1.client.WriteOption]): A
893+
option (optional[~.firestore_v1.client.WriteOption]): A
894894
write option to make assertions / preconditions on the server
895895
state of the document before applying changes.
896896
@@ -916,7 +916,7 @@ def get_transaction_id(transaction, read_operation=True):
916916
"""Get the transaction ID from a ``Transaction`` object.
917917
918918
Args:
919-
transaction (Optional[~google.cloud.firestore_v1.transaction.\
919+
transaction (Optional[~.firestore_v1.transaction.\
920920
Transaction]): An existing transaction that this query will
921921
run in.
922922
read_operation (Optional[bool]): Indicates if the transaction ID
@@ -979,7 +979,7 @@ class LastUpdateOption(WriteOption):
979979
"""Option used to assert a "last update" condition on a write operation.
980980
981981
This will typically be created by
982-
:meth:`~google.cloud.firestore_v1.client.Client.write_option`.
982+
:meth:`~.firestore_v1.client.Client.write_option`.
983983
984984
Args:
985985
last_update_time (google.protobuf.timestamp_pb2.Timestamp): A
@@ -1019,7 +1019,7 @@ class ExistsOption(WriteOption):
10191019
"""Option used to assert existence on a write operation.
10201020
10211021
This will typically be created by
1022-
:meth:`~google.cloud.firestore_v1.client.Client.write_option`.
1022+
:meth:`~.firestore_v1.client.Client.write_option`.
10231023
10241024
Args:
10251025
exists (bool): Indicates if the document being modified

‎google/cloud/firestore_v1/batch.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ class WriteBatch(object):
2222
"""Accumulate write operations to be sent in a batch.
2323
2424
This has the same set of methods for write operations that
25-
:class:`~google.cloud.firestore_v1.document.DocumentReference` does,
26-
e.g. :meth:`~google.cloud.firestore_v1.document.DocumentReference.create`.
25+
:class:`~.firestore_v1.document.DocumentReference` does,
26+
e.g. :meth:`~.firestore_v1.document.DocumentReference.create`.
2727
2828
Args:
29-
client (~google.cloud.firestore_v1.client.Client): The client that
29+
client (~.firestore_v1.client.Client): The client that
3030
created this batch.
3131
"""
3232

@@ -54,7 +54,7 @@ def create(self, reference, document_data):
5454
batch will fail when :meth:`commit`-ed.
5555
5656
Args:
57-
reference (~google.cloud.firestore_v1.document.DocumentReference): A
57+
reference (~.firestore_v1.document.DocumentReference): A
5858
document reference to be created in this batch.
5959
document_data (dict): Property names and values to use for
6060
creating a document.
@@ -66,12 +66,12 @@ def set(self, reference, document_data, merge=False):
6666
"""Add a "change" to replace a document.
6767
6868
See
69-
:meth:`~google.cloud.firestore_v1.document.DocumentReference.set` for
69+
:meth:`~.firestore_v1.document.DocumentReference.set` for
7070
more information on how ``option`` determines how the change is
7171
applied.
7272
7373
Args:
74-
reference (~google.cloud.firestore_v1.document.DocumentReference):
74+
reference (~.firestore_v1.document.DocumentReference):
7575
A document reference that will have values set in this batch.
7676
document_data (dict):
7777
Property names and values to use for replacing a document.
@@ -94,15 +94,15 @@ def update(self, reference, field_updates, option=None):
9494
"""Add a "change" to update a document.
9595
9696
See
97-
:meth:`~google.cloud.firestore_v1.document.DocumentReference.update` for
97+
:meth:`~.firestore_v1.document.DocumentReference.update` for
9898
more information on ``field_updates`` and ``option``.
9999
100100
Args:
101-
reference (~google.cloud.firestore_v1.document.DocumentReference): A
101+
reference (~.firestore_v1.document.DocumentReference): A
102102
document reference that will be deleted in this batch.
103103
field_updates (dict): Field names or paths to update and values
104104
to update with.
105-
option (Optional[~google.cloud.firestore_v1.client.WriteOption]): A
105+
option (Optional[~.firestore_v1.client.WriteOption]): A
106106
write option to make assertions / preconditions on the server
107107
state of the document before applying changes.
108108
"""
@@ -117,14 +117,14 @@ def delete(self, reference, option=None):
117117
"""Add a "change" to delete a document.
118118
119119
See
120-
:meth:`~google.cloud.firestore_v1.document.DocumentReference.delete` for
120+
:meth:`~.firestore_v1.document.DocumentReference.delete` for
121121
more information on how ``option`` determines how the change is
122122
applied.
123123
124124
Args:
125-
reference (~google.cloud.firestore_v1.document.DocumentReference): A
125+
reference (~.firestore_v1.document.DocumentReference): A
126126
document reference that will be deleted in this batch.
127-
option (Optional[~google.cloud.firestore_v1.client.WriteOption]): A
127+
option (Optional[~.firestore_v1.client.WriteOption]): A
128128
write option to make assertions / preconditions on the server
129129
state of the document before applying changes.
130130
"""

‎google/cloud/firestore_v1/client.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
1919
In the hierarchy of API concepts
2020
21-
* a :class:`~google.cloud.firestore_v1.client.Client` owns a
22-
:class:`~google.cloud.firestore_v1.collection.CollectionReference`
23-
* a :class:`~google.cloud.firestore_v1.client.Client` owns a
24-
:class:`~google.cloud.firestore_v1.document.DocumentReference`
21+
* a :class:`~.firestore_v1.client.Client` owns a
22+
:class:`~.firestore_v1.collection.CollectionReference`
23+
* a :class:`~.firestore_v1.client.Client` owns a
24+
:class:`~.firestore_v1.document.DocumentReference`
2525
"""
2626
from google.api_core.gapic_v1 import client_info
2727
from google.cloud.client import ClientWithProject
@@ -40,7 +40,7 @@
4040

4141

4242
DEFAULT_DATABASE = "(default)"
43-
"""str: The default database used in a :class:`~google.cloud.firestore.client.Client`."""
43+
"""str: The default database used in a :class:`~.firestore.client.Client`."""
4444
_BAD_OPTION_ERR = (
4545
"Exactly one of ``last_update_time`` or ``exists`` " "must be provided."
4646
)
@@ -108,7 +108,7 @@ def _firestore_api(self):
108108
"""Lazy-loading getter GAPIC Firestore API.
109109
110110
Returns:
111-
~google.cloud.gapic.firestore.v1.firestore_client.FirestoreClient: The
111+
~.gapic.firestore.v1.firestore_client.FirestoreClient: The
112112
GAPIC client with the credentials of the current client.
113113
"""
114114
if self._firestore_api_internal is None:
@@ -185,7 +185,7 @@ def collection(self, *collection_path):
185185
* A tuple of collection path segments
186186
187187
Returns:
188-
~google.cloud.firestore_v1.collection.CollectionReference: A reference
188+
~.firestore_v1.collection.CollectionReference: A reference
189189
to a collection in the Firestore database.
190190
"""
191191
if len(collection_path) == 1:
@@ -248,7 +248,7 @@ def document(self, *document_path):
248248
* A tuple of document path segments
249249
250250
Returns:
251-
~google.cloud.firestore_v1.document.DocumentReference: A reference
251+
~.firestore_v1.document.DocumentReference: A reference
252252
to a document in a collection.
253253
"""
254254
if len(document_path) == 1:
@@ -298,9 +298,9 @@ def field_path(*field_names):
298298
def write_option(**kwargs):
299299
"""Create a write option for write operations.
300300
301-
Write operations include :meth:`~google.cloud.DocumentReference.set`,
302-
:meth:`~google.cloud.DocumentReference.update` and
303-
:meth:`~google.cloud.DocumentReference.delete`.
301+
Write operations include :meth:`~.DocumentReference.set`,
302+
:meth:`~.DocumentReference.update` and
303+
:meth:`~.DocumentReference.delete`.
304304
305305
One of the following keyword arguments must be provided:
306306
@@ -352,7 +352,7 @@ def get_all(self, references, field_paths=None, transaction=None):
352352
If multiple ``references`` refer to the same document, the server
353353
will only return one result.
354354
355-
See :meth:`~google.cloud.firestore_v1.client.Client.field_path` for
355+
See :meth:`~.firestore_v1.client.Client.field_path` for
356356
more information on **field paths**.
357357
358358
If a ``transaction`` is used and it already has write operations
@@ -366,7 +366,7 @@ def get_all(self, references, field_paths=None, transaction=None):
366366
paths (``.``-delimited list of field names) to use as a
367367
projection of document fields in the returned results. If
368368
no value is provided, all fields will be returned.
369-
transaction (Optional[~google.cloud.firestore_v1.transaction.\
369+
transaction (Optional[~.firestore_v1.transaction.\
370370
Transaction]): An existing transaction that these
371371
``references`` will be retrieved in.
372372
@@ -391,7 +391,7 @@ def collections(self):
391391
"""List top-level collections of the client's database.
392392
393393
Returns:
394-
Sequence[~google.cloud.firestore_v1.collection.CollectionReference]:
394+
Sequence[~.firestore_v1.collection.CollectionReference]:
395395
iterator of subcollections of the current document.
396396
"""
397397
iterator = self._firestore_api.list_collection_ids(
@@ -405,7 +405,7 @@ def batch(self):
405405
"""Get a batch instance from this client.
406406
407407
Returns:
408-
~google.cloud.firestore_v1.batch.WriteBatch: A "write" batch to be
408+
~.firestore_v1.batch.WriteBatch: A "write" batch to be
409409
used for accumulating document changes and sending the changes
410410
all at once.
411411
"""
@@ -414,17 +414,17 @@ def batch(self):
414414
def transaction(self, **kwargs):
415415
"""Get a transaction that uses this client.
416416
417-
See :class:`~google.cloud.firestore_v1.transaction.Transaction` for
417+
See :class:`~.firestore_v1.transaction.Transaction` for
418418
more information on transactions and the constructor arguments.
419419
420420
Args:
421421
kwargs (Dict[str, Any]): The keyword arguments (other than
422422
``client``) to pass along to the
423-
:class:`~google.cloud.firestore_v1.transaction.Transaction`
423+
:class:`~.firestore_v1.transaction.Transaction`
424424
constructor.
425425
426426
Returns:
427-
~google.cloud.firestore_v1.transaction.Transaction: A transaction
427+
~.firestore_v1.transaction.Transaction: A transaction
428428
attached to this client.
429429
"""
430430
return Transaction(self, **kwargs)
@@ -433,7 +433,7 @@ def transaction(self, **kwargs):
433433
def _reference_info(references):
434434
"""Get information about document references.
435435
436-
Helper for :meth:`~google.cloud.firestore_v1.client.Client.get_all`.
436+
Helper for :meth:`~.firestore_v1.client.Client.get_all`.
437437
438438
Args:
439439
references (List[.DocumentReference, ...]): Iterable of document
@@ -461,7 +461,7 @@ def _get_reference(document_path, reference_map):
461461
"""Get a document reference from a dictionary.
462462
463463
This just wraps a simple dictionary look-up with a helpful error that is
464-
specific to :meth:`~google.cloud.firestore.client.Client.get_all`, the
464+
specific to :meth:`~.firestore.client.Client.get_all`, the
465465
**public** caller of this function.
466466
467467
Args:
@@ -493,7 +493,7 @@ def _parse_batch_get(get_doc_response, reference_map, client):
493493
reference_map (Dict[str, .DocumentReference]): A mapping (produced
494494
by :func:`_reference_info`) of fully-qualified document paths to
495495
document references.
496-
client (~google.cloud.firestore_v1.client.Client): A client that has
496+
client (~.firestore_v1.client.Client): A client that has
497497
a document factory.
498498
499499
Returns:

0 commit comments

Comments
 (0)