Skip to content

Iterating StreamGenerator yields Unknown type #1080

@woo-cie

Description

@woo-cie

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].

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-firestore version: 2.21.0

Steps to reproduce

  1. Setup environment as above
  2. Check the type shown by the IDE

Code example

db: Client

docs = db.collection("some_table").stream()
for doc in docs:
    pass
Image Image

Metadata

Metadata

Assignees

Labels

api: firestoreIssues related to the googleapis/python-firestore API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions