Repository navigation
fix(abstractions): pass mypy --strict in request_information and the small modules - #805
Merged
Vincent Biret (baywet) merged 1 commit intoOct 15, 2026
Conversation
…small modules Annotate request_information, utils, headers_collection, multipart_body and base_request_configuration. BaseRequestConfiguration now extends RequestConfiguration[Any], which is what the bare base class meant before. The return type on _get_serialization_writer showed that set_content_from_scalar stored the None returned by write_collection_of_primitive_values in a `writer` attribute on the writer. It now only calls the method. url returns the raw URL from the path parameters only when it is a str, like the C# getter. lazy_import raises ValueError when the module spec has no loader, instead of the TypeError from LazyLoader. Part of microsoft#722.
7 of 11 tasks
|
Vincent Biret (baywet)
approved these changes
Oct 15, 2026
Vincent Biret (baywet)
left a comment
Member
There was a problem hiding this comment.
Thanks for the contribution!
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.



Overview
Fifth item in #722.
request_information,utils,headers_collection,multipart_bodyandbase_request_configurationnow passmypy --strict, and errors inkiota_abstractionsgo from 20 to 7. The 7 left are in the serialization proxy factories, the next item.BaseRequestConfigurationnow extendsRequestConfiguration[Any], which is what the bare base class meant before, so old generated code that subclasses it sees no change.Adding types showed one bug:
set_content_from_scalarwith a list stored theNonereturned bywrite_collection_of_primitive_valuesin awriterattribute on the writer. It now only calls the method.Related Issue
Part of #722.
Notes
Two small runtime changes:
urluses the raw URL from the path parameters only when it is astr, like the C# getter.BaseRequestBuilderonly puts astrthere.lazy_importraisesValueErrorwhen the module spec has no loader, like its other checks, instead of theTypeErrorfromLazyLoader.Testing Instructions
mypy --strict kiota_abstractionsinpackages/abstractionsshows only the 7 proxy factory errors, also with--python-version 3.10.mypy kiota_abstractions,mypy validationintests/validation,yapf -dr kiota_abstractions,pylintandpytestpass.mypy --strict kiota_httpshows the same errors as on main.