Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong return type in AsyncCollectionReference.list_documents #918

Open
gblazq opened this issue Apr 24, 2024 · 1 comment
Open

Wrong return type in AsyncCollectionReference.list_documents #918

gblazq opened this issue Apr 24, 2024 · 1 comment
Assignees
Labels
api: firestore Issues related to the googleapis/python-firestore API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@gblazq
Copy link

gblazq commented Apr 24, 2024

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

  • google-cloud-firestore version: 2.15.0
@daniel-sanche
Copy link
Contributor

Thanks for the report. It's a known issue that the typing for this library is currently broken. We will make sure to address this with the others

@daniel-sanche daniel-sanche added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p3 Desirable enhancement or fix. May not be included in next release. labels Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: firestore Issues related to the googleapis/python-firestore API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

3 participants