Skip to content

[Identity] Update for next-pylint - #42994

Merged
pvaneck merged 1 commit into
Azure:mainfrom
pvaneck:identity-pylint-next
Sep 16, 2025
Merged

[Identity] Update for next-pylint#42994
pvaneck merged 1 commit into
Azure:mainfrom
pvaneck:identity-pylint-next

Conversation

@pvaneck

@pvaneck pvaneck commented Sep 13, 2025

Copy link
Copy Markdown
Member

This updates azure-identity to pass the next-pylint check.

One notable change:
The exception catching for the instantiation of SharedTokenCacheCredential was removed. The exception logging here causes pylint to complain with "Do not log exceptions in levels other than debug". However, this level of exception catching is no longer needed since it was initially put in because SharedTokenCacheCredential used to import msal_extensions which could potentially cause ImportErrors.

Now, SharedTokenCacheCredential constructors only have basic setup and potentially some validation (just like other credentials in DAC)

Closes: #40686

Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
@pvaneck
pvaneck marked this pull request as ready for review September 16, 2025 00:15
@pvaneck
pvaneck requested a review from xiangyan99 as a code owner September 16, 2025 00:15
Copilot AI review requested due to automatic review settings September 16, 2025 00:15
@pvaneck
pvaneck requested a review from a team as a code owner September 16, 2025 00:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 the azure-identity library to comply with next-pylint requirements by addressing specific linting issues around exception handling and logging practices.

Key changes:

  • Removes exception catching for SharedTokenCacheCredential instantiation that's no longer needed
  • Adds "from e" to exception re-raising to preserve stack traces
  • Adds pylint disable comments for logging raised errors

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
sdk/identity/azure-identity/azure/identity/aio/_credentials/shared_cache.py Updates exception handling to preserve stack trace with "from e"
sdk/identity/azure-identity/azure/identity/aio/_credentials/default.py Removes unnecessary exception handling around SharedTokenCacheCredential instantiation
sdk/identity/azure-identity/azure/identity/_internal/interactive.py Adds pylint disable comments for logging raised errors
sdk/identity/azure-identity/azure/identity/_credentials/shared_cache.py Updates exception handling to preserve stack trace with "from e"
sdk/identity/azure-identity/azure/identity/_credentials/default.py Removes unnecessary exception handling around SharedTokenCacheCredential instantiation

@pvaneck
pvaneck merged commit 0f5058b into Azure:main Sep 16, 2025
29 checks passed
@pvaneck
pvaneck deleted the identity-pylint-next branch September 16, 2025 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

azure-identity needs linting updates for pylint version 3.3.6

3 participants