Skip to content

[DRAFT] chore(firestore): improve typing for collection#16999

Draft
daniel-sanche wants to merge 5 commits intomainfrom
firestore-type-patch
Draft

[DRAFT] chore(firestore): improve typing for collection#16999
daniel-sanche wants to merge 5 commits intomainfrom
firestore-type-patch

Conversation

@daniel-sanche
Copy link
Copy Markdown
Contributor

Previously, CollectionReference didn't define .document(), so it inherited the typing of BaseCollectionReference. This PR adds an override to ensure that documents are annotated as returning DocumentReference types

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a document method to the CollectionReference class to facilitate the creation of sub-documents. Feedback includes improving type hint compatibility by using Union and string forward references to avoid runtime errors, adopting modern super() syntax, ensuring the cast function is imported, and correcting a redundant path in the docstring.

Comment thread packages/google-cloud-firestore/google/cloud/firestore_v1/collection.py Outdated
Comment thread packages/google-cloud-firestore/google/cloud/firestore_v1/collection.py Outdated
Comment thread packages/google-cloud-firestore/google/cloud/firestore_v1/collection.py Outdated
@daniel-sanche daniel-sanche changed the title chore(firestore): improve typing for collection [DRAFT] chore(firestore): improve typing for collection May 7, 2026
daniel-sanche and others added 4 commits May 7, 2026 14:37
…ection.py

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…ection.py

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…ection.py

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant