Skip to content

fix(firestore): remove usage of typing_extensions#17357

Merged
parthea merged 1 commit into
googleapis:mainfrom
shokkunrf:fix/firestore-remove-typing-extensions
Jun 3, 2026
Merged

fix(firestore): remove usage of typing_extensions#17357
parthea merged 1 commit into
googleapis:mainfrom
shokkunrf:fix/firestore-remove-typing-extensions

Conversation

@shokkunrf
Copy link
Copy Markdown
Contributor

Fixes #17244 🦕

This PR addresses the google-cloud-firestore portion of #17244 ("Remove usage of typing_extensions in google-cloud-python") by replacing the only typing_extensions import in this package with the stdlib typing equivalents.

Summary

google/cloud/firestore_v1/async_transaction.py was the sole module in google-cloud-firestore importing from typing_extensions. All three names it imports (Concatenate, ParamSpec, TypeVar) are available in the stdlib typing module since Python 3.10, and setup.py declares python_requires=">=3.10", so the import can be moved to the stdlib without any compatibility loss.

Changes

packages/google-cloud-firestore/google/cloud/firestore_v1/async_transaction.py:

  • Add Concatenate, ParamSpec, TypeVar to the existing from typing import (...) block (kept alphabetical).
  • Remove the from typing_extensions import Concatenate, ParamSpec, TypeVar line.

Why this works

Symbol Stdlib typing availability
Concatenate Python 3.10+
ParamSpec Python 3.10+
TypeVar Always available

Verification

In a clean venv with only google-cloud-firestore installed (no typing-extensions), from google.cloud.firestore_v1 import async_transaction now succeeds — confirming the dependency on typing-extensions is fully removed.

Scope note

Other packages in this monorepo also use typing_extensions (google-api-core, google-cloud-bigtable, google-cloud-spanner, bigframes). Each has its own python_requires and set of imported symbols (notably Self, which requires Python 3.11+ in the stdlib), so this PR is scoped to google-cloud-firestore only. Let me know if you'd like me to follow up with PRs for any of the others — happy to.

@shokkunrf shokkunrf requested a review from a team as a code owner June 3, 2026 12:24
@google-cla
Copy link
Copy Markdown

google-cla Bot commented Jun 3, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

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 refactors the imports in async_transaction.py by moving Concatenate, ParamSpec, and TypeVar from typing_extensions to the standard typing library. There are no review comments, and I have no additional feedback to provide.

@parthea
Copy link
Copy Markdown
Contributor

parthea commented Jun 3, 2026

Hi @shokkunrf, Thanks for opening a PR! Please could you sign the CLA? #17357 (comment)

@parthea parthea marked this pull request as draft June 3, 2026 14:35
@parthea parthea added kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. labels Jun 3, 2026
@yoshi-kokoro yoshi-kokoro removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Jun 3, 2026
@shokkunrf
Copy link
Copy Markdown
Contributor Author

@googlebot I signed it!

@shokkunrf shokkunrf marked this pull request as ready for review June 3, 2026 15:29
Copy link
Copy Markdown
Contributor

@parthea parthea left a comment

Choose a reason for hiding this comment

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

Thanks for the fix, @shokkunrf!

@shokkunrf
Copy link
Copy Markdown
Contributor Author

@googlebot I signed it!

@parthea parthea enabled auto-merge (squash) June 3, 2026 15:31
@parthea parthea assigned hebaalazzeh and unassigned shokkunrf Jun 3, 2026
@parthea parthea requested a review from hebaalazzeh June 3, 2026 15:38
Copy link
Copy Markdown
Contributor

@hebaalazzeh hebaalazzeh left a comment

Choose a reason for hiding this comment

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

Looks good to me. Nice cleanup!

@parthea parthea merged commit cdaf213 into googleapis:main Jun 3, 2026
32 of 34 checks passed
@shokkunrf
Copy link
Copy Markdown
Contributor Author

Thanks for the quick review and merge!

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.

Remove usage of typing_extensions in google-cloud-python

4 participants