refactor: remove dead zarr<3 (has_zarr_v3) guards in tests - #11376
Merged
dcherian merged 2 commits intoJun 5, 2026
Conversation
Contributor
Author
|
Thanks for the quick merge @dcherian! Nice to have the dead has_zarr_v3 guards out of the test suite. |
Contributor
Author
|
Much appreciated, @dcherian. Good to see the dead zarr<3 guards gone from the tests. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Removes the now-dead zarr v2 test guards built on
has_zarr_v3, which can no longer be false now that xarray requireszarr>=3.0.0.Why
xarray's lower bound for
zarris now3.0.0, so thehas_zarr_v3flag is always true whenever zarr is installed. Theskipif(not has_zarr_v3, ...)decorators andif has_zarr_v3:branches built on it are dead code that can never take the false path. Issue #11346 asks to clear out these stale 2.x guards so the test suite stops carrying conditionals that no longer mean anything.Description
Now that xarray's lower bound for
zarris3.0.0, thehas_zarr_v3flag inxarray/tests/__init__.pyis always true whenever zarr is installed, so theskipif(not has_zarr_v3, ...)decorators andif has_zarr_v3:branches built on it never take the false path. This removes those stale 2.x guards intest_backends.pyandtest_backends_datatree.pyand collapses the conditional inxarray/tests/__init__.py, keeping the formerly-guarded bodies. The still-meaningful version gateshas_zarr_v3_dtypes(3.1.0) andhas_zarr_v3_async_oindex(3.1.2) are left untouched, per issue #11346.Checklist
zarr<3#11346whats-new.rstapi.rstAI Disclosure
Tools: Claude