Fix DASVader anonymous reference handling - #774
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughChangesDASVader reference handling now directly dereferences HDF5 references, raises compatibility errors when resolution fails, and tests both anonymous-reference success and unresolved-reference failure. DASVader reference handling
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/test_io/test_dasvader/test_dasvader.py (1)
243-255: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winCover the compatibility-error branch too.
This test only proves successful dereferencing. Add a focused case where
h5[value]raisesKeyError, then assertDASVaderCompatibilityErrorand its guidance; otherwise the central error-handling regression could break while this test remains green.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/test_io/test_dasvader/test_dasvader.py` around lines 243 - 255, Add a focused test alongside test_dereference_anonymous_reference that exercises _dereference when resolving the reference through h5[value] raises KeyError. Assert that DASVaderCompatibilityError is raised and that its message includes the expected compatibility guidance, while keeping the existing successful dereference coverage unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tests/test_io/test_dasvader/test_dasvader.py`:
- Around line 243-255: Add a focused test alongside
test_dereference_anonymous_reference that exercises _dereference when resolving
the reference through h5[value] raises KeyError. Assert that
DASVaderCompatibilityError is raised and that its message includes the expected
compatibility guidance, while keeping the existing successful dereference
coverage unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: c5f6edc0-ab4a-432c-b297-2f9053c47f22
📒 Files selected for processing (3)
dascore/io/dasvader/core.pydascore/io/dasvader/utils.pytests/test_io/test_dasvader/test_dasvader.py
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #774 +/- ##
=======================================
Coverage 99.93% 99.93%
=======================================
Files 145 145
Lines 12859 12859
=======================================
Hits 12851 12851
Misses 8 8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Description
Legacy DASVader JLD2 files can contain readable HDF5 object references without linked object names. The compatibility guard introduced in #647 treated
h5r.get_name(...) is Noneas proof that a reference could not be read, so DASCore raisedDASVaderCompatibilityErroron compatible h5py/HDF5 stacks before attempting dereferencing.This change attempts
h5[value]first and translates an actualKeyErrorinto the existing compatibility error. It restores legacy-file reads with h5py 3.15/HDF5 1.14 while retaining the clear error under h5py 3.16/HDF5 2.0. The reader note now describes that behavior, and a self-contained regression test covers an anonymous but readable reference.Validation
pytest -q tests/test_io/test_dasvader/test_dasvader.pywith h5py 3.15.1/HDF5 1.14.6: 8 passed.(235000, 2)float32patch.pytest -q tests: 6320 passed, 83 skipped, 4 xfailed.pre-commit run --all: passed.Checklist
I have (if applicable):
Summary by CodeRabbit