fix(firestore): remove usage of typing_extensions#17357
Conversation
|
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. |
There was a problem hiding this comment.
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.
|
Hi @shokkunrf, Thanks for opening a PR! Please could you sign the CLA? #17357 (comment) |
|
@googlebot I signed it! |
parthea
left a comment
There was a problem hiding this comment.
Thanks for the fix, @shokkunrf!
|
@googlebot I signed it! |
hebaalazzeh
left a comment
There was a problem hiding this comment.
Looks good to me. Nice cleanup!
|
Thanks for the quick review and merge! |
Fixes #17244 🦕
This PR addresses the
google-cloud-firestoreportion of #17244 ("Remove usage of typing_extensions in google-cloud-python") by replacing the onlytyping_extensionsimport in this package with the stdlibtypingequivalents.Summary
google/cloud/firestore_v1/async_transaction.pywas the sole module ingoogle-cloud-firestoreimporting fromtyping_extensions. All three names it imports (Concatenate,ParamSpec,TypeVar) are available in the stdlibtypingmodule since Python 3.10, andsetup.pydeclarespython_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:Concatenate,ParamSpec,TypeVarto the existingfrom typing import (...)block (kept alphabetical).from typing_extensions import Concatenate, ParamSpec, TypeVarline.Why this works
typingavailabilityConcatenateParamSpecTypeVarVerification
In a clean venv with only
google-cloud-firestoreinstalled (notyping-extensions),from google.cloud.firestore_v1 import async_transactionnow succeeds — confirming the dependency ontyping-extensionsis 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 ownpython_requiresand set of imported symbols (notablySelf, which requires Python 3.11+ in the stdlib), so this PR is scoped togoogle-cloud-firestoreonly. Let me know if you'd like me to follow up with PRs for any of the others — happy to.