Skip to content

[v3-3-test] Fix mypy failure on datadog timer wrapped by shared observability Timer (#69202) - #70887

Merged
potiuk merged 1 commit into
apache:v3-3-testfrom
potiuk:cherry-pick-69202-v3-3-test
Aug 1, 2026
Merged

[v3-3-test] Fix mypy failure on datadog timer wrapped by shared observability Timer (#69202)#70887
potiuk merged 1 commit into
apache:v3-3-testfrom
potiuk:cherry-pick-69202-v3-3-test

Conversation

@potiuk

@potiuk potiuk commented Aug 1, 2026

Copy link
Copy Markdown
Member

Cherry-pick of #69202 to v3-3-test.

mypy-shared-observability fails on every PR targeting v3-3-test:
datadog_logger.py passes dogstatsd's TimedContextManagerDecorator into
Timer(...), whose real_timer is typed Timer | None. The fix retypes it
against a minimal BackendTimerProtocol (start()/stop()), which is what
the parameter actually accepts. Type-annotation-only, no runtime change.

This unblocks static checks on the branch — e.g. #70855, #70854, #70852.

(cherry picked from commit 5946046)


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 5)

Generated-by: Claude Code (Opus 5) following the guidelines

…er (apache#69202)

The real_timer parameter accepts any backend timer exposing start/stop
(pystatsd, dogstatsd), not the shared Timer itself. Typing it against a
minimal protocol reflects that contract and stops mypy rejecting the
typed dogstatsd TimedContextManagerDecorator.

(cherry picked from commit 5946046)
@potiuk
potiuk requested review from amoghrajesh and ashb as code owners August 1, 2026 01:56
@potiuk
potiuk merged commit ef95d55 into apache:v3-3-test Aug 1, 2026
4 checks passed
@potiuk
potiuk deleted the cherry-pick-69202-v3-3-test branch August 1, 2026 01:56
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.

2 participants