Skip to content

Commit

Permalink
Revert "Replace relative class refs with fully-qualifed names. (#8039…
Browse files Browse the repository at this point in the history
…)" (#8095)

This reverts commit 76e877d.
  • Loading branch information
tseaver committed May 22, 2019
1 parent 76e877d commit 2441825
Show file tree
Hide file tree
Showing 20 changed files with 296 additions and 296 deletions.
18 changes: 9 additions & 9 deletions google/cloud/firestore_v1/_helpers.py
Expand Up @@ -220,11 +220,11 @@ def reference_value_to_document(reference_value, client):
Args:
reference_value (str): A document reference value.
client (~google.cloud.firestore_v1.client.Client): A client that has
client (~.firestore_v1.client.Client): A client that has
a document factory.
Returns:
~google.cloud.firestore_v1.document.DocumentReference: The document
~.firestore_v1.document.DocumentReference: The document
corresponding to ``reference_value``.
Raises:
Expand Down Expand Up @@ -255,7 +255,7 @@ def decode_value(value, client):
Args:
value (google.cloud.firestore_v1.types.Value): A
Firestore protobuf to be decoded / parsed / converted.
client (~google.cloud.firestore_v1.client.Client): A client that has
client (~.firestore_v1.client.Client): A client that has
a document factory.
Returns:
Expand Down Expand Up @@ -301,7 +301,7 @@ def decode_dict(value_fields, client):
Args:
value_fields (google.protobuf.pyext._message.MessageMapContainer): A
protobuf map of Firestore ``Value``-s.
client (~google.cloud.firestore_v1.client.Client): A client that has
client (~.firestore_v1.client.Client): A client that has
a document factory.
Returns:
Expand Down Expand Up @@ -851,7 +851,7 @@ def pbs_for_update(document_path, field_updates, option):
document_path (str): A fully-qualified document path.
field_updates (dict): Field names or paths to update and values
to update with.
option (optional[~google.cloud.firestore_v1.client.WriteOption]): A
option (optional[~.firestore_v1.client.WriteOption]): A
write option to make assertions / preconditions on the server
state of the document before applying changes.
Expand Down Expand Up @@ -890,7 +890,7 @@ def pb_for_delete(document_path, option):
Args:
document_path (str): A fully-qualified document path.
option (optional[~google.cloud.firestore_v1.client.WriteOption]): A
option (optional[~.firestore_v1.client.WriteOption]): A
write option to make assertions / preconditions on the server
state of the document before applying changes.
Expand All @@ -916,7 +916,7 @@ def get_transaction_id(transaction, read_operation=True):
"""Get the transaction ID from a ``Transaction`` object.
Args:
transaction (Optional[~google.cloud.firestore_v1.transaction.\
transaction (Optional[~.firestore_v1.transaction.\
Transaction]): An existing transaction that this query will
run in.
read_operation (Optional[bool]): Indicates if the transaction ID
Expand Down Expand Up @@ -979,7 +979,7 @@ class LastUpdateOption(WriteOption):
"""Option used to assert a "last update" condition on a write operation.
This will typically be created by
:meth:`~google.cloud.firestore_v1.client.Client.write_option`.
:meth:`~.firestore_v1.client.Client.write_option`.
Args:
last_update_time (google.protobuf.timestamp_pb2.Timestamp): A
Expand Down Expand Up @@ -1019,7 +1019,7 @@ class ExistsOption(WriteOption):
"""Option used to assert existence on a write operation.
This will typically be created by
:meth:`~google.cloud.firestore_v1.client.Client.write_option`.
:meth:`~.firestore_v1.client.Client.write_option`.
Args:
exists (bool): Indicates if the document being modified
Expand Down
24 changes: 12 additions & 12 deletions google/cloud/firestore_v1/batch.py
Expand Up @@ -22,11 +22,11 @@ class WriteBatch(object):
"""Accumulate write operations to be sent in a batch.
This has the same set of methods for write operations that
:class:`~google.cloud.firestore_v1.document.DocumentReference` does,
e.g. :meth:`~google.cloud.firestore_v1.document.DocumentReference.create`.
:class:`~.firestore_v1.document.DocumentReference` does,
e.g. :meth:`~.firestore_v1.document.DocumentReference.create`.
Args:
client (~google.cloud.firestore_v1.client.Client): The client that
client (~.firestore_v1.client.Client): The client that
created this batch.
"""

Expand Down Expand Up @@ -54,7 +54,7 @@ def create(self, reference, document_data):
batch will fail when :meth:`commit`-ed.
Args:
reference (~google.cloud.firestore_v1.document.DocumentReference): A
reference (~.firestore_v1.document.DocumentReference): A
document reference to be created in this batch.
document_data (dict): Property names and values to use for
creating a document.
Expand All @@ -66,12 +66,12 @@ def set(self, reference, document_data, merge=False):
"""Add a "change" to replace a document.
See
:meth:`~google.cloud.firestore_v1.document.DocumentReference.set` for
:meth:`~.firestore_v1.document.DocumentReference.set` for
more information on how ``option`` determines how the change is
applied.
Args:
reference (~google.cloud.firestore_v1.document.DocumentReference):
reference (~.firestore_v1.document.DocumentReference):
A document reference that will have values set in this batch.
document_data (dict):
Property names and values to use for replacing a document.
Expand All @@ -94,15 +94,15 @@ def update(self, reference, field_updates, option=None):
"""Add a "change" to update a document.
See
:meth:`~google.cloud.firestore_v1.document.DocumentReference.update` for
:meth:`~.firestore_v1.document.DocumentReference.update` for
more information on ``field_updates`` and ``option``.
Args:
reference (~google.cloud.firestore_v1.document.DocumentReference): A
reference (~.firestore_v1.document.DocumentReference): A
document reference that will be deleted in this batch.
field_updates (dict): Field names or paths to update and values
to update with.
option (Optional[~google.cloud.firestore_v1.client.WriteOption]): A
option (Optional[~.firestore_v1.client.WriteOption]): A
write option to make assertions / preconditions on the server
state of the document before applying changes.
"""
Expand All @@ -117,14 +117,14 @@ def delete(self, reference, option=None):
"""Add a "change" to delete a document.
See
:meth:`~google.cloud.firestore_v1.document.DocumentReference.delete` for
:meth:`~.firestore_v1.document.DocumentReference.delete` for
more information on how ``option`` determines how the change is
applied.
Args:
reference (~google.cloud.firestore_v1.document.DocumentReference): A
reference (~.firestore_v1.document.DocumentReference): A
document reference that will be deleted in this batch.
option (Optional[~google.cloud.firestore_v1.client.WriteOption]): A
option (Optional[~.firestore_v1.client.WriteOption]): A
write option to make assertions / preconditions on the server
state of the document before applying changes.
"""
Expand Down
42 changes: 21 additions & 21 deletions google/cloud/firestore_v1/client.py
Expand Up @@ -18,10 +18,10 @@
In the hierarchy of API concepts
* a :class:`~google.cloud.firestore_v1.client.Client` owns a
:class:`~google.cloud.firestore_v1.collection.CollectionReference`
* a :class:`~google.cloud.firestore_v1.client.Client` owns a
:class:`~google.cloud.firestore_v1.document.DocumentReference`
* a :class:`~.firestore_v1.client.Client` owns a
:class:`~.firestore_v1.collection.CollectionReference`
* a :class:`~.firestore_v1.client.Client` owns a
:class:`~.firestore_v1.document.DocumentReference`
"""
from google.api_core.gapic_v1 import client_info
from google.cloud.client import ClientWithProject
Expand All @@ -40,7 +40,7 @@


DEFAULT_DATABASE = "(default)"
"""str: The default database used in a :class:`~google.cloud.firestore.client.Client`."""
"""str: The default database used in a :class:`~.firestore.client.Client`."""
_BAD_OPTION_ERR = (
"Exactly one of ``last_update_time`` or ``exists`` " "must be provided."
)
Expand Down Expand Up @@ -108,7 +108,7 @@ def _firestore_api(self):
"""Lazy-loading getter GAPIC Firestore API.
Returns:
~google.cloud.gapic.firestore.v1.firestore_client.FirestoreClient: The
~.gapic.firestore.v1.firestore_client.FirestoreClient: The
GAPIC client with the credentials of the current client.
"""
if self._firestore_api_internal is None:
Expand Down Expand Up @@ -185,7 +185,7 @@ def collection(self, *collection_path):
* A tuple of collection path segments
Returns:
~google.cloud.firestore_v1.collection.CollectionReference: A reference
~.firestore_v1.collection.CollectionReference: A reference
to a collection in the Firestore database.
"""
if len(collection_path) == 1:
Expand Down Expand Up @@ -248,7 +248,7 @@ def document(self, *document_path):
* A tuple of document path segments
Returns:
~google.cloud.firestore_v1.document.DocumentReference: A reference
~.firestore_v1.document.DocumentReference: A reference
to a document in a collection.
"""
if len(document_path) == 1:
Expand Down Expand Up @@ -298,9 +298,9 @@ def field_path(*field_names):
def write_option(**kwargs):
"""Create a write option for write operations.
Write operations include :meth:`~google.cloud.DocumentReference.set`,
:meth:`~google.cloud.DocumentReference.update` and
:meth:`~google.cloud.DocumentReference.delete`.
Write operations include :meth:`~.DocumentReference.set`,
:meth:`~.DocumentReference.update` and
:meth:`~.DocumentReference.delete`.
One of the following keyword arguments must be provided:
Expand Down Expand Up @@ -352,7 +352,7 @@ def get_all(self, references, field_paths=None, transaction=None):
If multiple ``references`` refer to the same document, the server
will only return one result.
See :meth:`~google.cloud.firestore_v1.client.Client.field_path` for
See :meth:`~.firestore_v1.client.Client.field_path` for
more information on **field paths**.
If a ``transaction`` is used and it already has write operations
Expand All @@ -366,7 +366,7 @@ def get_all(self, references, field_paths=None, transaction=None):
paths (``.``-delimited list of field names) to use as a
projection of document fields in the returned results. If
no value is provided, all fields will be returned.
transaction (Optional[~google.cloud.firestore_v1.transaction.\
transaction (Optional[~.firestore_v1.transaction.\
Transaction]): An existing transaction that these
``references`` will be retrieved in.
Expand All @@ -391,7 +391,7 @@ def collections(self):
"""List top-level collections of the client's database.
Returns:
Sequence[~google.cloud.firestore_v1.collection.CollectionReference]:
Sequence[~.firestore_v1.collection.CollectionReference]:
iterator of subcollections of the current document.
"""
iterator = self._firestore_api.list_collection_ids(
Expand All @@ -405,7 +405,7 @@ def batch(self):
"""Get a batch instance from this client.
Returns:
~google.cloud.firestore_v1.batch.WriteBatch: A "write" batch to be
~.firestore_v1.batch.WriteBatch: A "write" batch to be
used for accumulating document changes and sending the changes
all at once.
"""
Expand All @@ -414,17 +414,17 @@ def batch(self):
def transaction(self, **kwargs):
"""Get a transaction that uses this client.
See :class:`~google.cloud.firestore_v1.transaction.Transaction` for
See :class:`~.firestore_v1.transaction.Transaction` for
more information on transactions and the constructor arguments.
Args:
kwargs (Dict[str, Any]): The keyword arguments (other than
``client``) to pass along to the
:class:`~google.cloud.firestore_v1.transaction.Transaction`
:class:`~.firestore_v1.transaction.Transaction`
constructor.
Returns:
~google.cloud.firestore_v1.transaction.Transaction: A transaction
~.firestore_v1.transaction.Transaction: A transaction
attached to this client.
"""
return Transaction(self, **kwargs)
Expand All @@ -433,7 +433,7 @@ def transaction(self, **kwargs):
def _reference_info(references):
"""Get information about document references.
Helper for :meth:`~google.cloud.firestore_v1.client.Client.get_all`.
Helper for :meth:`~.firestore_v1.client.Client.get_all`.
Args:
references (List[.DocumentReference, ...]): Iterable of document
Expand Down Expand Up @@ -461,7 +461,7 @@ def _get_reference(document_path, reference_map):
"""Get a document reference from a dictionary.
This just wraps a simple dictionary look-up with a helpful error that is
specific to :meth:`~google.cloud.firestore.client.Client.get_all`, the
specific to :meth:`~.firestore.client.Client.get_all`, the
**public** caller of this function.
Args:
Expand Down Expand Up @@ -493,7 +493,7 @@ def _parse_batch_get(get_doc_response, reference_map, client):
reference_map (Dict[str, .DocumentReference]): A mapping (produced
by :func:`_reference_info`) of fully-qualified document paths to
document references.
client (~google.cloud.firestore_v1.client.Client): A client that has
client (~.firestore_v1.client.Client): A client that has
a document factory.
Returns:
Expand Down

0 comments on commit 2441825

Please sign in to comment.