Skip to content

Commit cdaf213

Browse files
authored
fix(firestore): remove usage of typing_extensions (#17357)
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.
1 parent a3d93af commit cdaf213

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,15 @@
2222
AsyncGenerator,
2323
Awaitable,
2424
Callable,
25+
Concatenate,
2526
Generic,
2627
Optional,
28+
ParamSpec,
29+
TypeVar,
2730
)
2831

2932
from google.api_core import exceptions, gapic_v1
3033
from google.api_core import retry_async as retries
31-
from typing_extensions import Concatenate, ParamSpec, TypeVar
3234

3335
from google.cloud.firestore_v1 import _helpers, async_batch
3436
from google.cloud.firestore_v1.async_document import AsyncDocumentReference

0 commit comments

Comments
 (0)