diff --git a/google/cloud/firestore_v1/collection.py b/google/cloud/firestore_v1/collection.py index 51ee311798..12e9ec883d 100644 --- a/google/cloud/firestore_v1/collection.py +++ b/google/cloud/firestore_v1/collection.py @@ -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 @@ -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. @@ -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. @@ -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. @@ -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.