Skip to content

Fix fill_value=null zarr v2 to v3 conversion for string dtypes#845

Merged
maxrjones merged 15 commits into
zarr-developers:mainfrom
observingClouds:fix/zarrv2_str_fillval
Jan 27, 2026
Merged

Fix fill_value=null zarr v2 to v3 conversion for string dtypes#845
maxrjones merged 15 commits into
zarr-developers:mainfrom
observingClouds:fix/zarrv2_str_fillval

Conversation

@observingClouds
Copy link
Copy Markdown
Contributor

@observingClouds observingClouds commented Dec 24, 2025

Adds support to convert unset/null fill values from zarr format 2 metadata to format 3 for string types.

@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.03%. Comparing base (052f7d1) to head (9be6948).
⚠️ Report is 64 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #845      +/-   ##
==========================================
+ Coverage   88.99%   89.03%   +0.04%     
==========================================
  Files          34       34              
  Lines        1945     1943       -2     
==========================================
- Hits         1731     1730       -1     
+ Misses        214      213       -1     
Files with missing lines Coverage Δ
virtualizarr/manifests/array.py 84.94% <100.00%> (+3.22%) ⬆️
virtualizarr/parsers/dmrpp.py 83.33% <100.00%> (ø)
virtualizarr/parsers/zarr.py 97.46% <100.00%> (-1.29%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@maxrjones
Copy link
Copy Markdown
Member

thanks for working on this, please feel welcome to ping whenever you need a review

@observingClouds observingClouds marked this pull request as ready for review January 8, 2026 08:49
@observingClouds
Copy link
Copy Markdown
Contributor Author

@maxrjones and others please have a look now. I am not sure if I did the casting correctly to fix the mypy error, but all is passing now. I have also tested that my test is failing with the previous version.

Copy link
Copy Markdown
Member

@maxrjones maxrjones left a comment

Choose a reason for hiding this comment

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

Thanks @observingClouds

I think the other fix from #826 (comment) (if not np.issubdtype(self.dtype, dtype):) is also needed to close out #826. Do you want to include that fix in this PR?

Comment thread virtualizarr/parsers/zarr.py Outdated
Comment thread virtualizarr/tests/test_parsers/test_zarr.py
observingClouds and others added 2 commits January 26, 2026 08:24
Co-authored-by: Max Jones <14077947+maxrjones@users.noreply.github.com>
@observingClouds
Copy link
Copy Markdown
Contributor Author

Alright @maxrjones, I included now the fix mentioned in #826 (comment) and ensured with an additional test that this code is effective (failed without/succeeds with fix)

I also had to do some mypy fix, which I believe is unrelated and originates from a mypy update. Let me know if I shall exclude this from this PR, otherwise I think this is good to go.

Copy link
Copy Markdown
Member

@maxrjones maxrjones left a comment

Choose a reason for hiding this comment

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

thanks for this fix!

@maxrjones maxrjones merged commit 1bda5f1 into zarr-developers:main Jan 27, 2026
15 checks passed
@observingClouds observingClouds deleted the fix/zarrv2_str_fillval branch January 27, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't concat virtual datasets without dropping CF variables

2 participants