Skip to content

Conversation

@pvaneck
Copy link
Member

@pvaneck pvaneck commented Jan 6, 2026

This updates azure-core and corehttp to pass the next-mypy checks.

Closes: #43506
Closes: #43505

@pvaneck pvaneck marked this pull request as ready for review January 6, 2026 22:04
Copilot AI review requested due to automatic review settings January 6, 2026 22:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates type annotations in azure-core and corehttp to resolve next-mypy compatibility issues. The changes include making the encoding setter parameter properly typed as Optional[str] (aligning with the property getter's return type), and adding assertions to ensure session is not None after calling open() in async transport implementations.

Key changes:

  • Updated encoding setter parameter type from str to Optional[str] in both azure-core and corehttp
  • Added assertions in async transport classes to satisfy mypy's type checking for session usage

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
sdk/core/corehttp/corehttp/rest/_http_response_impl.py Updated encoding setter parameter type to Optional[str] and corresponding documentation
sdk/core/azure-core/azure/core/rest/_http_response_impl.py Updated encoding setter parameter type to Optional[str] and corresponding documentation
sdk/core/azure-core/azure/core/pipeline/transport/_requests_trio.py Added assertion after open() to ensure session is not None for mypy
sdk/core/azure-core/azure/core/pipeline/transport/_requests_asyncio.py Added assertion after open() to ensure session is not None for mypy

This updates azure-core and corehttp to pass the next-mypy checks.

Signed-off-by: Paul Van Eck <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

corehttp needs typing updates for mypy version 1.18.1 azure-core needs typing updates for mypy version 1.18.1

1 participant