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

feat: Add error handling for empty sequence in First() method #228

Merged
merged 3 commits into from
Jul 4, 2024

Conversation

gordonwatts
Copy link
Member

@gordonwatts gordonwatts commented Jul 2, 2024

  • Add check to make sure all First() calls check to make sure something was found.
  • Raise an exception with some bad error message when it happens.

Fixes #227

The changes in test_first_last.py and test_xaod_aggragate.py fix the assertion statements to correctly check the length of the first_lines list.
Copy link

codecov bot commented Jul 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.11%. Comparing base (b352b78) to head (469c1c3).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #228      +/-   ##
==========================================
+ Coverage   95.05%   95.11%   +0.05%     
==========================================
  Files          35       35              
  Lines        2002     2005       +3     
  Branches      265      265              
==========================================
+ Hits         1903     1907       +4     
+ Misses         64       63       -1     
  Partials       35       35              
Flag Coverage Δ
unittests 95.11% <100.00%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gordonwatts gordonwatts self-assigned this Jul 4, 2024
@gordonwatts gordonwatts added the enhancement New feature or request label Jul 4, 2024
@gordonwatts gordonwatts merged commit 1f06547 into master Jul 4, 2024
40 checks passed
@gordonwatts gordonwatts deleted the feat/first_fail branch July 4, 2024 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

First should fail if there is nothing "first"
1 participant