fix(storage): preserve leading slashes in FsspecStore.path#3926
Open
d-v-b wants to merge 2 commits intozarr-developers:mainfrom
Open
fix(storage): preserve leading slashes in FsspecStore.path#3926d-v-b wants to merge 2 commits intozarr-developers:mainfrom
d-v-b wants to merge 2 commits intozarr-developers:mainfrom
Conversation
zarr-developers#3924 ran the constructor's `path` argument through `normalize_path`, which is intended for zarr logical keys and strips leading slashes. Applied to a filesystem-side root, this turned absolute paths like /home/foo/data.zarr into the relative home/foo/data.zarr, breaking LocalFileSystem-backed FsspecStore for any caller that passed an absolute path. Downstream impact: titiler-xarray's test-upstream job fails on every dataset_3d.zarr fixture access. The original zarr-developers#3922 issue (path="/" producing "//key" via _join_paths) is still resolved: rstrip("/") collapses "/" to "", so the join filter drops it. Trailing slashes are also still stripped. Updates the existing test_fsspec_store_path_normalization parametrization with the new (correct) expectations and adds two absolute-path cases. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3926 +/- ##
=======================================
Coverage 93.11% 93.11%
=======================================
Files 85 85
Lines 11365 11365
=======================================
Hits 10582 10582
Misses 783 783
🚀 New features to boost your workflow:
|
maxrjones
approved these changes
Apr 28, 2026
Member
maxrjones
left a comment
There was a problem hiding this comment.
Is the changelog entry necessary? This regression wasn't released, which makes me wonder if it adds confusion rather than clarity. It could be better as an in-line comment to prevent future mistakes with this fragile part of the codebase.
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.
#3924 ran the constructor's
pathargument throughnormalize_path,which is intended for zarr logical keys and strips leading slashes.
Applied to a filesystem-side root, this turned absolute paths like
/home/foo/data.zarr into the relative home/foo/data.zarr, breaking
LocalFileSystem-backed FsspecStore for any caller that passed an
absolute path. Downstream impact: titiler-xarray's test-upstream job
fails on every dataset_3d.zarr fixture access.
The original #3922 issue (path="/" producing "//key" via _join_paths)
is still resolved: rstrip("/") collapses "/" to "", so the join filter
drops it. Trailing slashes are also still stripped.
Updates the existing test_fsspec_store_path_normalization
parametrization with the new (correct) expectations and adds two
absolute-path cases.
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com
cc @vincentsarago