Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use correct type hint for '*path' args #300

Merged
merged 2 commits into from Feb 4, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions google/cloud/firestore_v1/async_client.py
Expand Up @@ -49,7 +49,7 @@
from google.cloud.firestore_v1.services.firestore.transports import (
grpc_asyncio as firestore_grpc_transport,
)
from typing import Any, AsyncGenerator, Iterable, Tuple
from typing import Any, AsyncGenerator, Iterable


class AsyncClient(BaseClient):
Expand Down Expand Up @@ -119,7 +119,7 @@ def _target(self):
"""
return self._target_helper(firestore_client.FirestoreAsyncClient)

def collection(self, *collection_path: Tuple[str]) -> AsyncCollectionReference:
def collection(self, *collection_path: str) -> AsyncCollectionReference:
"""Get a reference to a collection.

For a top-level collection:
Expand All @@ -139,7 +139,7 @@ def collection(self, *collection_path: Tuple[str]) -> AsyncCollectionReference:
Sub-collections can be nested deeper in a similar fashion.

Args:
collection_path (Tuple[str, ...]): Can either be
collection_path: Can either be

* A single ``/``-delimited path to a collection
* A tuple of collection path segments
Expand Down Expand Up @@ -172,7 +172,7 @@ def collection_group(self, collection_id: str) -> AsyncCollectionGroup:
"""
return AsyncCollectionGroup(self._get_collection_reference(collection_id))

def document(self, *document_path: Tuple[str]) -> AsyncDocumentReference:
def document(self, *document_path: str) -> AsyncDocumentReference:
"""Get a reference to a document in a collection.

For a top-level document:
Expand All @@ -194,7 +194,7 @@ def document(self, *document_path: Tuple[str]) -> AsyncDocumentReference:
Documents in sub-collections can be nested deeper in a similar fashion.

Args:
document_path (Tuple[str, ...]): Can either be
document_path: Can either be

* A single ``/``-delimited path to a document
* A tuple of document path segments
Expand Down
4 changes: 2 additions & 2 deletions google/cloud/firestore_v1/base_client.py
Expand Up @@ -314,7 +314,7 @@ def _document_path_helper(self, *document_path) -> List[str]:
return joined_path.split(_helpers.DOCUMENT_PATH_DELIMITER)

@staticmethod
def field_path(*field_names: Tuple[str]) -> str:
def field_path(*field_names: str) -> str:
"""Create a **field path** from a list of nested field names.

A **field path** is a ``.``-delimited concatenation of the field
Expand All @@ -335,7 +335,7 @@ def field_path(*field_names: Tuple[str]) -> str:
``data['aa']['bb']['cc']``.

Args:
field_names (Tuple[str, ...]): The list of field names.
field_names: The list of field names.

Returns:
str: The ``.``-delimited field path.
Expand Down
10 changes: 5 additions & 5 deletions google/cloud/firestore_v1/client.py
Expand Up @@ -44,7 +44,7 @@
from google.cloud.firestore_v1.services.firestore.transports import (
grpc as firestore_grpc_transport,
)
from typing import Any, Generator, Iterable, Tuple
from typing import Any, Generator, Iterable

# Types needed only for Type Hints
from google.cloud.firestore_v1.base_document import DocumentSnapshot
Expand Down Expand Up @@ -117,7 +117,7 @@ def _target(self):
"""
return self._target_helper(firestore_client.FirestoreClient)

def collection(self, *collection_path: Tuple[str]) -> CollectionReference:
def collection(self, *collection_path: str) -> CollectionReference:
"""Get a reference to a collection.

For a top-level collection:
Expand All @@ -137,7 +137,7 @@ def collection(self, *collection_path: Tuple[str]) -> CollectionReference:
Sub-collections can be nested deeper in a similar fashion.

Args:
collection_path (Tuple[str, ...]): Can either be
collection_path: Can either be

* A single ``/``-delimited path to a collection
* A tuple of collection path segments
Expand Down Expand Up @@ -170,7 +170,7 @@ def collection_group(self, collection_id: str) -> CollectionGroup:
"""
return CollectionGroup(self._get_collection_reference(collection_id))

def document(self, *document_path: Tuple[str]) -> DocumentReference:
def document(self, *document_path: str) -> DocumentReference:
"""Get a reference to a document in a collection.

For a top-level document:
Expand All @@ -192,7 +192,7 @@ def document(self, *document_path: Tuple[str]) -> DocumentReference:
Documents in sub-collections can be nested deeper in a similar fashion.

Args:
document_path (Tuple[str, ...]): Can either be
document_path): Can either be

* A single ``/``-delimited path to a document
* A tuple of document path segments
Expand Down