fix(events): type pull_executor concretely in _hold_leases (#1596) - #1698
Open
shobhitagnihotri69 wants to merge 1 commit into
Open
shobhitagnihotri69 wants to merge 1 commit into
shobhitagnihotri69 wants to merge 1 commit into
Conversation
…1596) Type pull_executor concretely as concurrent.futures.ThreadPoolExecutor in _hold_leases rather than Any. The caller statically knows and passes the non-None ThreadPoolExecutor established by self._pull_executor, and concurrent.futures is already imported at module scope. Leaves subscriber: Any untouched as the PubSub client is imported lazily. Resolves caura-ai#1596
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Types
pull_executorconcretely asconcurrent.futures.ThreadPoolExecutorin_hold_leasesinstead ofAny.Related Issue
Closes #1596
Type of Change
How Has This Been Tested?
py_compile).ruff check common/events/pubsub.pyandruff format --check common/events/pubsub.py(all checks passed)._pull_loopstatically establishespull_executorfromself._pull_executor(concurrent.futures.ThreadPoolExecutor | None) after narrowing awayNone. Becauseconcurrent.futuresis already imported at module scope (L49), this restores the concrete type without introducing any new imports or behavior changes.subscriber: Anyuntouched as described in Type pull_executor concretely in _hold_leases instead of Any #1596 to maintain lazy import ergonomics for non-GCP environments.Checklist
ruff checkandruff format --checkpassmypypassespytestpasses locallyCHANGELOG.mdunder theUnreleasedsection (if user-facing)Additional Notes
Maintains byte-compatibility for downstream reconciliation and enterprise vendoring as noted in #1596 by @Eldad-Caura.