Skip to content

Fix invalid HDF5 path error handling - #550

Open
MahirAbbas wants to merge 1 commit into
masterfrom
fix-invalid-h5-path
Open

Fix invalid HDF5 path error handling#550
MahirAbbas wants to merge 1 commit into
masterfrom
fix-invalid-h5-path

Conversation

@MahirAbbas

Copy link
Copy Markdown
Contributor

Fixes #412 and adds test for it

@MahirAbbas MahirAbbas self-assigned this Aug 10, 2026
@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 47.88%. Comparing base (a936eac) to head (c0b5248).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #550      +/-   ##
==========================================
+ Coverage   47.86%   47.88%   +0.01%     
==========================================
  Files          95       95              
  Lines        7673     7673              
  Branches      669      669              
==========================================
+ Hits         3673     3674       +1     
+ Misses       3808     3807       -1     
  Partials      192      192              

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@MahirAbbas
MahirAbbas requested a review from ajgdls August 11, 2026 11:10
@MahirAbbas
MahirAbbas marked this pull request as ready for review August 11, 2026 11:10
@Ohisemega
Ohisemega self-requested a review August 12, 2026 16:38

@JamesOHeaDLS JamesOHeaDLS left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @MahirAbbas - looks good, and I appreciate you making a test to go with it.

I've only made 2 minor suggestions for changes.

Also, thanks for introducing me to caplog - that is new to me and I'm going to start using it in my code

Comment on lines +191 to +193
assert "Failed to create file" in caplog.text
assert "PermissionError" in caplog.text
assert "Permission denied" in caplog.text

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could be reduced to assert str(error) in caplog.text

Comment on lines +185 to +189
error = PermissionError(13, "Permission denied", "/invalid/test_meta.h5")

with patch("odin_data.meta_writer.meta_writer.h5py.File", side_effect=error):
with caplog.at_level(logging.ERROR):
writer._create_file("/invalid/test_meta.h5", dataset_size=1)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor tweak to avoid repetition - bring "/invalid/test_meta.h5" out into a variable which is used in error and the create_file call

@Ohisemega Ohisemega added bug BUG! Needs fixing! MEDIUM-PRIORITY Tag issues as medium-relevance or medium-importance for now. labels Aug 13, 2026
@Ohisemega Ohisemega added this to the in-progress milestone Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug BUG! Needs fixing! MEDIUM-PRIORITY Tag issues as medium-relevance or medium-importance for now.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Meta writer crashes with invalid h5 path

3 participants