Skip to content

Do not allow exceptions in ManifestStore #683

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jul 18, 2025
Merged

Conversation

maxrjones
Copy link
Member

@maxrjones maxrjones commented Jul 16, 2025

Zarr python allows some exceptions to pass because nodes in the hierarchy that contain only fill values can be represented by missing files. We have a different way of representing missing files after #668, so we should never be expecting to have a failed get request due to a FileNotFoundError. I don't think we should expect the other errors used in regular Zarr store implementations.

TODO:

  • Fix failing DMR++ tests, which likely relate to the test data not actually existing.
  • Fix TestToVirtualXarray tests
  • Closes #xxxx
  • Tests added
  • Tests passing
  • Full type hint coverage
  • Changes are documented in docs/releases.rst
  • New functions/methods are listed in api.rst
  • New functionality has documentation

@maxrjones maxrjones marked this pull request as draft July 16, 2025 16:14
@maxrjones maxrjones added this to the v2.0.0 milestone Jul 16, 2025
Copy link

codecov bot commented Jul 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.24%. Comparing base (1a00c95) to head (36e907e).
Report is 2 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #683      +/-   ##
===========================================
- Coverage    88.51%   88.24%   -0.28%     
===========================================
  Files           33       33              
  Lines         1802     1803       +1     
===========================================
- Hits          1595     1591       -4     
- Misses         207      212       +5     
Files with missing lines Coverage Δ
virtualizarr/manifests/store.py 88.54% <100.00%> (+0.08%) ⬆️

... and 1 file with indirect coverage changes

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

@maxrjones
Copy link
Member Author

@TomNicholas the tests required major changes because we can no longer point to fake files (which would previously just return NaNs). I got 3/4 of the way through the DMR++ tests and then decided to open #685 regarding the relative file tests and remove some unit tests that seemed redundant with a better approach of property tests (#394). In summary, I'd appreciate your review with the understanding that we can put more work into improving the DMRPP tests after the release.

@maxrjones maxrjones marked this pull request as ready for review July 16, 2025 23:20
Copy link
Member

@TomNicholas TomNicholas left a comment

Choose a reason for hiding this comment

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

The actual changes to the error-checking code seem fine to me.

Just so I understand - the new dmrpp fixture actually points to real (temporary) netcdf data, whereas previously it was just a shell of some kind?

FYI @ayushnag @betolink. It would be nice to get to the point where the DMR++ reader can live outside of VirtualiZarr's main repo...

Comment on lines +141 to +143
"0.0": {"path": "file:///foo.0.0.nc", "offset": 0, "length": 8},
"1.0": {"path": "file:///foo.0.0.nc", "offset": 0, "length": 8},
"2.0": {"path": "file:///foo.0.0.nc", "offset": 0, "length": 8},
Copy link
Member

Choose a reason for hiding this comment

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

Why did the length of these need to change?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because the chunks are emulating two 4 byte numbers.

Copy link
Member

Choose a reason for hiding this comment

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

But it doesn't actually matter for these tests right? You're just making it neater.

@maxrjones
Copy link
Member Author

Just so I understand - the new dmrpp fixture actually points to real (temporary) netcdf data, whereas previously it was just a shell of some kind?

That's right. I assume the dmrpp fixtures were created from some real data, but the matching files weren't documented or available to the tests.

FYI @ayushnag @betolink. It would be nice to get to the point where the DMR++ reader can live outside of VirtualiZarr's main repo...

👍 https://github.com/virtual-zarr could be a good spot 😄

@maxrjones maxrjones merged commit 88cf1f4 into develop Jul 18, 2025
13 checks passed
@maxrjones maxrjones deleted the no-allowed-exceptions branch July 18, 2025 14:16
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