Repository navigation
Stop mass transfer partitions failing on an empty StudyTime - #425
Conversation
pydicom's TM("") and DA("") return None, so convert_to_python_time and
convert_to_python_date hit their assert on an empty value and raised a bare
AssertionError. The handlers added in #400 only catch ValueError, so one
study with an empty StudyTime failed its whole mass transfer partition, with
an empty task message and again on every retry.
StudyDate and StudyTime are Type 2 and may legitimately be empty, so this is
PACS input rather than an internal invariant. The converters now raise
ValueError for empty values, as pydicom does for malformed ones: an empty
StudyTime falls back to midnight and an empty StudyDate skips only that study.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe date and time conversion functions now raise ChangesDICOM empty value handling
Priority: ⚪ Not assessed Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to Empty dates are skipped with a warning, and empty times retain the midnight fallback. No merge-blocking risk was identified in the reviewed change. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to Empty study times can now be handled without failing a mass-transfer partition. The study still passes through the existing filters and transfer controls. The change affects operational behavior, but the review found no new security boundary or control bypass. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
_study_datetime→ResultDataset.StudyTime→convert_to_python_timeatassert time_valuerep is not None: pydicom'sTM("")returnsNone, so a study with an empty StudyTime raised a bareAssertionError. The handlers from Make mass transfer discovery resilient to non-conformant StudyDate/StudyTime #400 only catchValueError, so that one study failed the whole partition, again on every retry.convert_to_python_date/convert_to_python_timenow raiseValueErrorfor empty values, as pydicom already does for malformed ones.WARNING.ResultDataset.StudyDate/StudyTime(selective transfer, batch query/transfer, DICOM explorer) are unchanged: they still fail on such a study, now with aValueErrornaming the empty value instead of a bareAssertionError.Test plan
test_convert_to_python_{date,time}_rejects_empty_valuefailed withAssertionErrorbefore the fix and pass aftertest_discover_series_salvages_malformed_study_timefrom Make mass transfer discovery resilient to non-conformant StudyDate/StudyTime #400 is now parametrized astest_discover_series_salvages_unparseable_study_time[non-conformant|empty]; theemptycase reproduced the production traceback before the fix and now falls back to midnightdicom_webmarkers); acceptance tests not run locallyruff check .,pyright,djlint . --lintclean🤖 Generated with Claude Code
Summary by CodeRabbit