|
25 | 25 | from google.cloud.firestore_v1 import aggregation |
26 | 26 | from google.cloud.firestore_v1.watch import Watch |
27 | 27 | from google.cloud.firestore_v1 import document |
28 | | -from typing import Any, Callable, Generator, Tuple |
| 28 | +from typing import Any, Callable, Generator, Tuple, Union |
29 | 29 |
|
30 | 30 | # Types needed only for Type Hints |
31 | 31 | from google.cloud.firestore_v1.transaction import Transaction |
@@ -79,9 +79,9 @@ def _aggregation_query(self) -> aggregation.AggregationQuery: |
79 | 79 | def add( |
80 | 80 | self, |
81 | 81 | document_data: dict, |
82 | | - document_id: str | None = None, |
| 82 | + document_id: Union[str, None] = None, |
83 | 83 | retry: retries.Retry = gapic_v1.method.DEFAULT, |
84 | | - timeout: float | None = None, |
| 84 | + timeout: Union[float, None] = None, |
85 | 85 | ) -> Tuple[Any, Any]: |
86 | 86 | """Create a document in the Firestore database with the provided data. |
87 | 87 |
|
@@ -121,9 +121,9 @@ def add( |
121 | 121 |
|
122 | 122 | def list_documents( |
123 | 123 | self, |
124 | | - page_size: int | None = None, |
| 124 | + page_size: Union[int, None] = None, |
125 | 125 | retry: retries.Retry = gapic_v1.method.DEFAULT, |
126 | | - timeout: float | None = None, |
| 126 | + timeout: Union[float, None] = None, |
127 | 127 | ) -> Generator[Any, Any, None]: |
128 | 128 | """List all subdocuments of the current collection. |
129 | 129 |
|
@@ -156,9 +156,9 @@ def _chunkify(self, chunk_size: int): |
156 | 156 |
|
157 | 157 | def get( |
158 | 158 | self, |
159 | | - transaction: Transaction | None = None, |
| 159 | + transaction: Union[Transaction, None] = None, |
160 | 160 | retry: retries.Retry = gapic_v1.method.DEFAULT, |
161 | | - timeout: float | None = None, |
| 161 | + timeout: Union[float, None] = None, |
162 | 162 | ) -> list: |
163 | 163 | """Read the documents in this collection. |
164 | 164 |
|
@@ -187,9 +187,9 @@ def get( |
187 | 187 |
|
188 | 188 | def stream( |
189 | 189 | self, |
190 | | - transaction: Transaction | None = None, |
| 190 | + transaction: Union[Transaction, None] = None, |
191 | 191 | retry: retries.Retry = gapic_v1.method.DEFAULT, |
192 | | - timeout: float | None = None, |
| 192 | + timeout: Union[float, None] = None, |
193 | 193 | ) -> Generator[document.DocumentSnapshot, Any, None]: |
194 | 194 | """Read the documents in this collection. |
195 | 195 |
|
|
0 commit comments