-
Notifications
You must be signed in to change notification settings - Fork 83
Closed
Labels
api: firestoreIssues related to the googleapis/python-firestore API.Issues related to the googleapis/python-firestore API.
Description
Iterating StreamGenerator in a for loop yields type Unknown.
In the code example, it should yield DocumentSnapshot.
This can be fixed by changing StreamGenerator.__iter__ ’s return type from StreamGenerator to StreamGenerator[T].
python-firestore/google/cloud/firestore_v1/stream_generator.py
Lines 53 to 54 in 4983639
| def __iter__(self) -> StreamGenerator: | |
| return self |
Environment details
- OS type and version: Windows 11
- Python version: 3.9.13
- pip version: uv-pip 0.6.12
google-cloud-firestoreversion: 2.21.0
Steps to reproduce
- Setup environment as above
- Check the type shown by the IDE
Code example
db: Client
docs = db.collection("some_table").stream()
for doc in docs:
pass

Metadata
Metadata
Assignees
Labels
api: firestoreIssues related to the googleapis/python-firestore API.Issues related to the googleapis/python-firestore API.