Skip to content

Fix accumulated validation error counts across module updates - #305

Merged
mrbean-bremen merged 1 commit into
pydicom:mainfrom
jdotc1:jdotc1/validation-result-unique-count-20261022
Oct 26, 2026
Merged

mrbean-bremen merged 1 commit into
pydicom:mainfrom
jdotc1:jdotc1/validation-result-unique-count-20261022

Conversation

@jdotc1

@jdotc1 jdotc1 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Describe the changes

ValidationResult.add_tag_errors updates the stored module map but calculates the count delta from the incoming batch size. Repeated updates can therefore reduce the total even when retained errors are unchanged or increase.

Calculate the delta from the merged map instead. This preserves per-module tag deduplication, replacement of existing errors, and errors counted separately from module maps.

Added regression coverage for disjoint, overlapping, repeated and empty updates, module separation, and existing counts. The production change is one line.

Validation performed on Python 3.12:

  • New tests: 10 failed / 4 passed before the fix; 14 passed after it.
  • Validator suite excluding two HTML tests that require external documentation access: 115 passed, 2 deselected.
  • The complete validator suite was attempted: those same two HTML tests fail with DNS resolution errors on both untouched and patched source; the other 115 pass.
  • Black checks for each changed Python file, Ruff, scoped mypy, pyupgrade and patch/whitespace checks passed.

Hosted validation at 4987a6e3: the upstream test matrix passes on Linux, macOS and Windows; pre-commit.ci also passes.

No new dependency or public interface change.

Tasks

  • Unit tests added
  • Fix added
  • Entry to release notes added
  • Pre-commit CI shows no errors
  • Complete upstream unit-test matrix passes

Documentation build: not applicable; no documentation page or API documentation changed.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.42%. Comparing base (e8644e2) to head (4987a6e).
⚠️ Report is 228 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #305      +/-   ##
==========================================
+ Coverage   89.82%   90.42%   +0.59%     
==========================================
  Files          15       21       +6     
  Lines        1632     2130     +498     
==========================================
+ Hits         1466     1926     +460     
- Misses        166      204      +38     

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

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

@mrbean-bremen mrbean-bremen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mrbean-bremen
mrbean-bremen merged commit 8213f1e into pydicom:main Oct 26, 2026
18 checks passed
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.

3 participants