Skip to content

chore(firestore): improve typing for collection#16999

Merged
daniel-sanche merged 6 commits into
mainfrom
firestore-type-patch
Jun 19, 2026
Merged

chore(firestore): improve typing for collection#16999
daniel-sanche merged 6 commits into
mainfrom
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

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

Copy link
Copy Markdown
Contributor

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 5 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>
@daniel-sanche daniel-sanche changed the title [DRAFT] chore(firestore): improve typing for collection chore(firestore): improve typing for collection Jun 19, 2026
@daniel-sanche daniel-sanche marked this pull request as ready for review June 19, 2026 00:09
@daniel-sanche daniel-sanche requested a review from a team as a code owner June 19, 2026 00:09
@daniel-sanche daniel-sanche enabled auto-merge (squash) June 19, 2026 00:18

@chalmerlowe chalmerlowe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@daniel-sanche daniel-sanche merged commit 141ad0e into main Jun 19, 2026
31 checks passed
@daniel-sanche daniel-sanche deleted the firestore-type-patch branch June 19, 2026 05:06
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.

2 participants