Skip to content

Add missing return type annotations to LogRecordProcessor and LoggerProvider#5008

Open
joshwilhelmi wants to merge 1 commit intoopen-telemetry:mainfrom
joshwilhelmi:fix/logs-shutdown-type-annotations
Open

Add missing return type annotations to LogRecordProcessor and LoggerProvider#5008
joshwilhelmi wants to merge 1 commit intoopen-telemetry:mainfrom
joshwilhelmi:fix/logs-shutdown-type-annotations

Conversation

@joshwilhelmi
Copy link

Summary

Several methods in the _logs module are missing -> None return type annotations, causing mypy no-untyped-call errors for downstream callers using strict type checking:

  • LogRecordProcessor.on_emit() (abstract)
  • LogRecordProcessor.shutdown() (abstract)
  • ConcurrentMultiLogRecordProcessor.on_emit()
  • ConcurrentMultiLogRecordProcessor.shutdown()
  • LoggerProvider.shutdown()

The sibling classes (MultiLogRecordProcessor.on_emit(), MultiLogRecordProcessor.shutdown(), TracerProvider.shutdown()) already have correct -> None annotations — this PR aligns the logs module to match.

Changes

  • Added -> None return type annotation to the 5 methods listed above

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Testing

No behavioral change — only adds missing type annotations. Existing tests are unaffected.

…rovider

The abstract `LogRecordProcessor.on_emit()` and `shutdown()` methods,
`ConcurrentMultiLogRecordProcessor.on_emit()` and `shutdown()`, and
`LoggerProvider.shutdown()` were missing `-> None` return type
annotations. This causes mypy `no-untyped-call` errors for callers
using strict type checking.

The sibling classes (`MultiLogRecordProcessor`, `TracerProvider`) already
have correct annotations — this aligns the logs module to match.
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Mar 23, 2026

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: joshwilhelmi / name: Josh Wilhelmi (9ecf89c)

@lzchen lzchen added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Mar 24, 2026
@xrmx
Copy link
Contributor

xrmx commented Mar 25, 2026

@joshwilhelmi I think that is one of the reasons we are using pyright :)

@xrmx xrmx moved this to Easy to review / merge / close in Python PR digest Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Skip Changelog PRs that do not require a CHANGELOG.md entry

Projects

Status: Easy to review / merge / close

Development

Successfully merging this pull request may close these issues.

3 participants