Skip to content

fix(events): type pull_executor concretely in _hold_leases (#1596) - #1698

Open
shobhitagnihotri69 wants to merge 1 commit into
caura-ai:mainfrom
shobhitagnihotri69:fix/1596-type-pull-executor-concretely
Open

shobhitagnihotri69 wants to merge 1 commit into
caura-ai:mainfrom
shobhitagnihotri69:fix/1596-type-pull-executor-concretely

Conversation

@shobhitagnihotri69

Copy link
Copy Markdown

Summary

Types pull_executor concretely as concurrent.futures.ThreadPoolExecutor in _hold_leases instead of Any.

Related Issue

Closes #1596

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that changes existing behavior)
  • Documentation update
  • Refactor / internal cleanup
  • Other:

How Has This Been Tested?

  • Verified with Python 3.12 compilation (py_compile).
  • Verified with ruff check common/events/pubsub.py and ruff format --check common/events/pubsub.py (all checks passed).
  • Caller _pull_loop statically establishes pull_executor from self._pull_executor (concurrent.futures.ThreadPoolExecutor | None) after narrowing away None. Because concurrent.futures is already imported at module scope (L49), this restores the concrete type without introducing any new imports or behavior changes.
  • Preserved sibling subscriber: Any untouched as described in Type pull_executor concretely in _hold_leases instead of Any #1596 to maintain lazy import ergonomics for non-GCP environments.

Checklist

  • I have read CONTRIBUTING.md
  • I have added tests that cover my changes (or explained why none are needed)
  • ruff check and ruff format --check pass
  • mypy passes
  • pytest passes locally
  • I have updated relevant documentation (README, docs, etc.)
  • I have updated CHANGELOG.md under the Unreleased section (if user-facing)

Additional Notes

Maintains byte-compatibility for downstream reconciliation and enterprise vendoring as noted in #1596 by @Eldad-Caura.

…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
@shobhitagnihotri69
shobhitagnihotri69 requested a review from a team as a code owner September 23, 2026 08:42

This branch has not been deployed

No deployments
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.

Type pull_executor concretely in _hold_leases instead of Any

1 participant