Skip to content

fix: crash when comparing metrics with None values#1529

Closed
mdqst wants to merge 1 commit intoOpenZeppelin:mainfrom
mdqst:patch-1
Closed

fix: crash when comparing metrics with None values#1529
mdqst wants to merge 1 commit intoOpenZeppelin:mainfrom
mdqst:patch-1

Conversation

@mdqst
Copy link
Copy Markdown

@mdqst mdqst commented Sep 14, 2025

updated compare_subdicts and markdown_subtable to safely handle cases where old[file] or new[file] might be None.
using (old.get(file) or {}).get(metric) and (new.get(file) or {}).get(metric) prevents AttributeError and ensures the comparison works reliably.

PR Checklist

  • Tests
  • Documentation
  • Added entry to CHANGELOG.md
  • Tried the feature on a public network

@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.38%. Comparing base (fc94206) to head (0c75053).
⚠️ Report is 65 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1529   +/-   ##
=======================================
  Coverage   92.38%   92.38%           
=======================================
  Files          82       82           
  Lines        2272     2272           
=======================================
  Hits         2099     2099           
  Misses        173      173           

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fc94206...0c75053. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ericnordelo
Copy link
Copy Markdown
Member

In this specific scenario, files should never be None so it is actually better for the case to fail with AttributeError.

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.

2 participants