[Identity] Update for next-pylint - #42994
Merged
Merged
Conversation
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
pvaneck
marked this pull request as ready for review
September 16, 2025 00:15
pvaneck
requested review from
KarishmaGhiya,
anannya03,
g2vinay,
joshfree,
minhanh-phan and
scottaddie
September 16, 2025 00:15
Contributor
There was a problem hiding this comment.
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 |
xiangyan99
approved these changes
Sep 16, 2025
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.
This updates azure-identity to pass the next-pylint check.
One notable change:
The exception catching for the instantiation of
SharedTokenCacheCredentialwas 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 becauseSharedTokenCacheCredentialused to importmsal_extensionswhich could potentially cause ImportErrors.Now,
SharedTokenCacheCredentialconstructors only have basic setup and potentially some validation (just like other credentials in DAC)Closes: #40686