-
Notifications
You must be signed in to change notification settings - Fork 107
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
Fixes MSPileup GET Filter Parsing #11886
Fixes MSPileup GET Filter Parsing #11886
Conversation
Jenkins results:
|
for key in kwargs.get('filters', []): | ||
projection[key] = 1 | ||
filters = kwargs.get('filters', []) | ||
if type(filters) == str: |
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.
Dennis, I would suggest the following variation to this code (but the result would be the same):
filters = kwargs.get('filters', [])
if isinstance(filters, str):
filters = [filters]
for key in kwargs.get('filters', []):
# filter out empty strings
etc etc
Jenkins results:
|
f2ecd90
to
94a7c82
Compare
Jenkins results:
|
94a7c82
to
2ee1323
Compare
Jenkins results:
|
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.
@d-ylee Dennis, even though you haven't asked for another review, I went ahead and looked at this code. If you did want to have another review, please always go through the GitHub "Request review" interface.
Changes are looking good to me, however I did leave 2 minor questions/suggestions. Thanks
@@ -12,7 +12,7 @@ | |||
from WMCore.MicroService.MSCore.MSCore import MSCore | |||
from WMCore.MicroService.DataStructs.DefaultStructs import PILEUP_REPORT | |||
from WMCore.MicroService.MSPileup.MSPileupData import MSPileupData | |||
from WMCore.MicroService.MSPileup.MSPileupError import MSPileupNoKeyFoundError | |||
# from WMCore.MicroService.MSPileup.MSPileupError import MSPileupNoKeyFoundError |
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 it is not used, feel free to completely remove it.
@@ -27,7 +27,8 @@ def __init__(self, msConfig, **kwargs): | |||
# Get the RSE expression for Disk RSEs from the configuration | |||
self.diskRSEExpr = msConfig.get("rucioDiskExpression", "") | |||
|
|||
def status(self): | |||
@staticmethod | |||
def status(): |
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.
Just for my education, I guess you made this change just because this method does not depend on any of the object data, right? Is there any other motivation/benefit that I might be missing?
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 believe so. I changed this because it came up in Pylint.
Converts single filter to list instead of a str Skip empty string filters Removed unused import
Fixed pylint warnings
2ee1323
to
a8e0b18
Compare
Jenkins results:
|
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.
Thanks Dennis, it looks good to me!
Fixes #11882
Status
Ready
Description
Checks to see if a filter is a string (one filters provided) and sets it to the projection dictionary. Ignores any empty strings as a filter.
Is it backward compatible (if not, which system it affects?)
Yes
Related PRs
Discovered during #11870
External dependencies / deployment changes
No