Fix annotation for inspect.BoundArguments.arguments#15853
Open
prasanthcakewalk wants to merge 1 commit into
Open
Fix annotation for inspect.BoundArguments.arguments#15853prasanthcakewalk wants to merge 1 commit into
prasanthcakewalk wants to merge 1 commit into
Conversation
Contributor
|
Diff from mypy_primer, showing the effect of this PR on open source code: dd-trace-py (https://github.com/DataDog/dd-trace-py)
+ ddtrace/llmobs/decorators.py:217: error: Argument 1 to "_get_span_inputs" has incompatible type "dict[str, Any]"; expected "OrderedDict[Any, Any]" [arg-type]
+ ddtrace/llmobs/decorators.py:233: error: Argument 1 to "_get_span_inputs" has incompatible type "dict[str, Any]"; expected "OrderedDict[Any, Any]" [arg-type]
+ ddtrace/llmobs/decorators.py:254: error: Argument 1 to "_get_span_inputs" has incompatible type "dict[str, Any]"; expected "OrderedDict[Any, Any]" [arg-type]
+ ddtrace/llmobs/decorators.py:279: error: Argument 1 to "_get_span_inputs" has incompatible type "dict[str, Any]"; expected "OrderedDict[Any, Any]" [arg-type]
|
Member
|
The new errors in ddtrace are true positives (but it's an easy fix: just change the annotation on https://github.com/DataDog/dd-trace-py/blob/e92c95792923aad3ae99c5942792e78f71f31cc4/ddtrace/llmobs/decorators.py#L35). |
JelleZijlstra
added a commit
to JelleZijlstra/dd-trace-py
that referenced
this pull request
Jun 2, 2026
This function gets passed the `.args` attribute of the `inspect.BoundArguments` structure, which is in fact a dict, not an OrderedDict. We're fixing this in typeshed python/typeshed#15853; this PR will make it so your type checker won't start emitting errors here when you next update your typeshed.
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 a minor issue in the annotations for the
inspect.BoundArgumentsclass reported in #15832.@JelleZijlstra