Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request fixes pylint 4.0.4 compatibility issues across the azure-monitor-opentelemetry package. The changes address new linting rules by improving code quality through better import ordering, adding necessary encoding specifications, removing unused imports, and adding appropriate pylint disable comments where the warnings are intentional or false positives.
Changes:
- Removed unused imports and duplicate test methods
- Standardized import ordering (stdlib → third-party → azure packages)
- Added
encoding='utf-8'parameter to allopen()calls - Added pylint disable comments for intentional patterns (broad exceptions in samples, unused mock parameters in tests, etc.)
- Improved code quality (e.g., using context manager for
urlopen, renaming unclear parameter names, usingsys.exit()instead ofexit())
Reviewed changes
Copilot reviewed 41 out of 41 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test_utils.py | Removed unused import, added pylint disables for line length and unused arguments |
| test_configurations.py | Reordered imports, removed duplicate test method, added pylint disables |
| test_configure.py | Removed unused imports, added pylint disable for too-many-public-methods |
| test_psycopg2.py | Reordered imports (pytest after stdlib) |
| test_status_logger.py | Added encoding='utf-8' to open() calls |
| test_diagnostic_logging.py | Removed unused import, added encoding, added pylint disables |
| test_distro.py | Added pylint disable for unused-argument |
| test_configurator.py | Removed unused import, added pylint disable |
| Tracing samples (11 files) | Reordered imports, added pylint disables for intentional broad exceptions and other patterns |
| Django samples (5 files) | Import reordering, parameter renames (_request prefix), pylint disables |
| Metrics samples (5 files) | Import reordering, parameter renames (_options prefix), pylint disables |
| Logging samples (4 files) | Import reordering, parameter renames, pylint disables |
| Authentication samples (2 files) | Import reordering |
| instrumentation.py | Added pylint disable for logging warning without debug check |
| diagnostic_logging.py | Added pylint disable for logging error without debug check |
sdk/monitor/azure-monitor-opentelemetry/samples/tracing/sampling_configurations.py
Show resolved
Hide resolved
JacksonWeber
approved these changes
Feb 6, 2026
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.
All SDK Contribution checklist:
General Guidelines and Best Practices