Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions google/cloud/firestore_v1/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from google.cloud.firestore_v1 import aggregation
from google.cloud.firestore_v1.watch import Watch
from google.cloud.firestore_v1 import document
from typing import Any, Callable, Generator, Tuple
from typing import Any, Callable, Generator, Tuple, Union

# Types needed only for Type Hints
from google.cloud.firestore_v1.transaction import Transaction
Expand Down Expand Up @@ -79,9 +79,9 @@ def _aggregation_query(self) -> aggregation.AggregationQuery:
def add(
self,
document_data: dict,
document_id: str = None,
document_id: Union[str, None] = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
timeout: Union[float, None] = None,
) -> Tuple[Any, Any]:
"""Create a document in the Firestore database with the provided data.

Expand Down Expand Up @@ -121,9 +121,9 @@ def add(

def list_documents(
self,
page_size: int = None,
page_size: Union[int, None] = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
timeout: Union[float, None] = None,
) -> Generator[Any, Any, None]:
"""List all subdocuments of the current collection.

Expand Down Expand Up @@ -156,9 +156,9 @@ def _chunkify(self, chunk_size: int):

def get(
self,
transaction: Transaction = None,
transaction: Union[Transaction, None] = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
timeout: Union[float, None] = None,
) -> list:
"""Read the documents in this collection.

Expand Down Expand Up @@ -187,9 +187,9 @@ def get(

def stream(
self,
transaction: Transaction = None,
transaction: Union[Transaction, None] = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
timeout: Union[float, None] = None,
) -> Generator[document.DocumentSnapshot, Any, None]:
"""Read the documents in this collection.

Expand Down