-
Notifications
You must be signed in to change notification settings - Fork 16
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
Fix: refactor gather elements #1124
Conversation
60267f5
to
c9529cb
Compare
return active_profiles | ||
|
||
@staticmethod | ||
def gather_profiles_from_config_file(active_profiles): |
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.
probably better would be name it merge_profiles_*
, because you we have active_profiles
that mutable variable and it's super unclear that we modifying it inside function and after that using it on top level.
It seems this peace of code we using on both functions (super similar) can we reuse it? And I think merge_profiles
would be good name for this method.
for key, profile in profiles.items():
if key in active_profiles:
if not profile.get("enabled", True):
celery_logger.info(f"disabling profile {key}")
del active_profiles[key]
else:
active_profiles[key] = profile
else:
active_profiles[key] = profile
P.S. If dangerous to touch this code we can stay with current approach
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.
I've extracted the common part to new method, but I wouldn't try to merge them into one
c9529cb
to
c12f451
Compare
207cf2e
to
41d50e2
Compare
🎉 This PR is included in version 1.12.1-beta.5 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Description
Refactor of gather_elements() method.
Fixes # (issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
manual, unit, integration
Checklist