Skip to content

Commit 565cd0f

Browse files
authored
Fix type hinting in collection.py
Mostly adding `| None` on all fields that may have `None` as a default value.
1 parent 5e97076 commit 565cd0f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

google/cloud/firestore_v1/collection.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ def _aggregation_query(self) -> aggregation.AggregationQuery:
7979
def add(
8080
self,
8181
document_data: dict,
82-
document_id: str = None,
82+
document_id: str | None = None,
8383
retry: retries.Retry = gapic_v1.method.DEFAULT,
84-
timeout: float = None,
84+
timeout: float | None = None,
8585
) -> Tuple[Any, Any]:
8686
"""Create a document in the Firestore database with the provided data.
8787
@@ -121,9 +121,9 @@ def add(
121121

122122
def list_documents(
123123
self,
124-
page_size: int = None,
124+
page_size: int | None = None,
125125
retry: retries.Retry = gapic_v1.method.DEFAULT,
126-
timeout: float = None,
126+
timeout: float | None = None,
127127
) -> Generator[Any, Any, None]:
128128
"""List all subdocuments of the current collection.
129129
@@ -156,9 +156,9 @@ def _chunkify(self, chunk_size: int):
156156

157157
def get(
158158
self,
159-
transaction: Transaction = None,
159+
transaction: Transaction | None = None,
160160
retry: retries.Retry = gapic_v1.method.DEFAULT,
161-
timeout: float = None,
161+
timeout: float | None = None,
162162
) -> list:
163163
"""Read the documents in this collection.
164164
@@ -187,9 +187,9 @@ def get(
187187

188188
def stream(
189189
self,
190-
transaction: Transaction = None,
190+
transaction: Transaction | None = None,
191191
retry: retries.Retry = gapic_v1.method.DEFAULT,
192-
timeout: float = None,
192+
timeout: float | None = None,
193193
) -> Generator[document.DocumentSnapshot, Any, None]:
194194
"""Read the documents in this collection.
195195

0 commit comments

Comments
 (0)