googleapis / python-firestore

Apache License 2.0
212 stars 70 forks source link

Wrong return type in AsyncCollectionReference.list_documents #918

Open gblazq opened 2 months ago

gblazq commented 2 months ago

AsyncCollectionReference.list_documents's return type is AsyncGenerator[DocumentReference, None]. However, since this is an AsyncCollection, it should be AsyncGenerator[AsyncDocumentReference, None].

Similarly, in base_collection._item_to_document_ref the return type should be DocumentReference | AsyncDocumentReference, since it's using the collection's document method and that can return either type depending on the collection.

With the wrong types code editors and lint tools get confused :)

Environment details