Repository navigation
Declare AnyValue and AttributeValue as explicit type aliases - #5703
Merged
Merged
Conversation
`AnyValue = AttributeValue = ...` is a chained assignment, which type checkers don't recognize as a type alias: mypy rejects both names and pyright rejects `AnyValue`, so annotations using them fail with `valid-type` / `reportInvalidTypeForm`. Fixes open-telemetry#5701 Assisted-by: Claude Opus 5.5
Assisted-by: Claude Opus 5.5
Pull request dashboard statusMerged · refreshed 2026-09-29 07:38 UTC Status above doesn't look right?
|
herin049
approved these changes
Sep 28, 2026
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved review issues remain.
Review effort: Lite
Findings: None
What changed in this PR
Fixes static type-checker recognition of AnyValue and AttributeValue by declaring them as explicit type aliases.
Changes:
- Adds
TypeAliasdeclarations for both public aliases. - Adds a changelog entry.
| File | Description |
|---|---|
opentelemetry-api/src/opentelemetry/util/types.py |
Defines explicit type aliases. |
.changelog/5703.fixed |
Documents the typing fix. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
Author
|
Thanks for the label @herin049 - can you also re-run the failing checks? |
xrmx
approved these changes
Sep 29, 2026
Merged
via the queue into
open-telemetry:main
with commit Sep 29, 2026
a514e9e
1723 of 1727 checks passed
emdneto
pushed a commit
that referenced
this pull request
Oct 6, 2026
…5750) * Declare AnyValue and AttributeValue as explicit type aliases `AnyValue = AttributeValue = ...` is a chained assignment, which type checkers don't recognize as a type alias: mypy rejects both names and pyright rejects `AnyValue`, so annotations using them fail with `valid-type` / `reportInvalidTypeForm`. Fixes #5701 Assisted-by: Claude Opus 5.5 * Add changelog fragment Assisted-by: Claude Opus 5.5 Co-authored-by: Jim Bennett <jimbobbennett@mac.com>
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.
Fixes #5701
Description
AnyValue = AttributeValue = ...is a chained assignment, which type checkers don't recognize as a type alias: mypy rejects both names and pyright rejectsAnyValue, so annotations using them fail withvalid-type/reportInvalidTypeForm.Fixes #5701
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Verified with mypy and pyright. This was causing downstream issues in OpenInference and this change fixes those.
Does This PR Require a Contrib Repo Change?
Checklist: