-
Notifications
You must be signed in to change notification settings - Fork 825
refactor: remove redundant pylint disable from celery instrumentation #3839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
refactor: remove redundant pylint disable from celery instrumentation #3839
Conversation
e00110a to
d501764
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are going to move this globally I would expect the other 30 occurences of the pylint disable to move removed too. Said that the lint warning may be useful in other cases.
d501764 to
985b02f
Compare
…y-python-contrib into cleanup/remove-pylint-disable-celery
Pull request updated |
Description
This PR removes the redundant
pylint: disable=attribute-defined-outside-initcomment from the celery instrumentation and adds this rule to the global pylint disable list in.pylintrc.The
attribute-defined-outside-initpylint rule is problematic for OpenTelemetry instrumentations because attributes are commonly set during instrumentation (in methods like_instrument()) rather than in__init__. This pattern is used throughout the codebase (30+ occurrences) and is a standard practice for OpenTelemetry instrumentations where attributes are initialized during the instrumentation process.By disabling this rule globally, we eliminate the need for individual
pylint: disablecomments across the codebase, making the code cleaner and more maintainable.Fixes #3828
Type of change
How Has This Been Tested?
attribute-defined-outside-inithas been added to the global pylint disable listDoes This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.