Skip to content
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

Conversation

d-ylee
Copy link
Contributor

@d-ylee d-ylee commented Feb 5, 2024

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

@d-ylee d-ylee requested a review from amaltaro February 5, 2024 20:52
@cmsdmwmbot
Copy link

Jenkins results:

  • Python3 Unit tests: succeeded
    • 2 changes in unstable tests
  • Python3 Pylint check: failed
    • 1 warnings and errors that must be fixed
    • 7 comments to review
  • Pylint py3k check: succeeded
  • Pycodestyle check: succeeded
    • 1 comments to review

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-WMCore-PR-test/14819/artifact/artifacts/PullRequestReport.html

for key in kwargs.get('filters', []):
projection[key] = 1
filters = kwargs.get('filters', [])
if type(filters) == str:
Copy link
Contributor

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

@cmsdmwmbot
Copy link

Jenkins results:

  • Python3 Unit tests: failed
    • 2 new failures
    • 1 changes in unstable tests
  • Python3 Pylint check: failed
    • 1 warnings and errors that must be fixed
    • 6 comments to review
  • Pylint py3k check: succeeded
  • Pycodestyle check: succeeded
    • 1 comments to review

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-WMCore-PR-test/14820/artifact/artifacts/PullRequestReport.html

@d-ylee d-ylee force-pushed the 11882-incorrect-parsing-and-handling-of-mspileup-get-parameters branch from f2ecd90 to 94a7c82 Compare February 6, 2024 04:40
@cmsdmwmbot
Copy link

Jenkins results:

  • Python3 Unit tests: failed
    • 1 new failures
    • 2 changes in unstable tests
  • Python3 Pylint check: succeeded
    • 5 comments to review
  • Pylint py3k check: succeeded
  • Pycodestyle check: succeeded
    • 1 comments to review

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-WMCore-PR-test/14821/artifact/artifacts/PullRequestReport.html

@d-ylee d-ylee force-pushed the 11882-incorrect-parsing-and-handling-of-mspileup-get-parameters branch from 94a7c82 to 2ee1323 Compare February 6, 2024 04:56
@cmsdmwmbot
Copy link

Jenkins results:

  • Python3 Unit tests: succeeded
    • 2 changes in unstable tests
  • Python3 Pylint check: succeeded
    • 3 comments to review
  • Pylint py3k check: succeeded
  • Pycodestyle check: succeeded

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-WMCore-PR-test/14822/artifact/artifacts/PullRequestReport.html

Copy link
Contributor

@amaltaro amaltaro left a 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
Copy link
Contributor

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():
Copy link
Contributor

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?

Copy link
Contributor Author

@d-ylee d-ylee Feb 6, 2024

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
@d-ylee d-ylee force-pushed the 11882-incorrect-parsing-and-handling-of-mspileup-get-parameters branch from 2ee1323 to a8e0b18 Compare February 6, 2024 20:09
@d-ylee d-ylee requested a review from amaltaro February 6, 2024 20:09
@cmsdmwmbot
Copy link

Jenkins results:

  • Python3 Unit tests: succeeded
    • 3 tests no longer failing
    • 1 changes in unstable tests
  • Python3 Pylint check: succeeded
    • 2 comments to review
  • Pylint py3k check: succeeded
  • Pycodestyle check: succeeded

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-WMCore-PR-test/14826/artifact/artifacts/PullRequestReport.html

Copy link
Contributor

@amaltaro amaltaro left a 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!

@amaltaro amaltaro merged commit 34a0a81 into dmwm:master Feb 6, 2024
3 of 4 checks passed
@d-ylee d-ylee deleted the 11882-incorrect-parsing-and-handling-of-mspileup-get-parameters branch February 7, 2024 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect parsing and handling of MSPileup GET parameters
3 participants