Commit cdaf213
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
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
| 28 | + | |
| 29 | + | |
27 | 30 | | |
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
31 | | - | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| |||
0 commit comments