Skip to content

fix: apply path normalization to fsspec store#3924

Merged
d-v-b merged 4 commits intozarr-developers:mainfrom
d-v-b:fix/path-normalization
Apr 24, 2026
Merged

fix: apply path normalization to fsspec store#3924
d-v-b merged 4 commits intozarr-developers:mainfrom
d-v-b:fix/path-normalization

Conversation

@d-v-b
Copy link
Copy Markdown
Contributor

@d-v-b d-v-b commented Apr 23, 2026

apply path normalization to the fsspecstore.path attribute.

closes #3922

@github-actions github-actions Bot added the needs release notes Automatically applied to PRs which haven't added release notes label Apr 23, 2026
@github-actions github-actions Bot removed the needs release notes Automatically applied to PRs which haven't added release notes label Apr 23, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.11%. Comparing base (0733a99) to head (1ee7114).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3924   +/-   ##
=======================================
  Coverage   93.11%   93.11%           
=======================================
  Files          85       85           
  Lines       11365    11365           
=======================================
  Hits        10582    10582           
  Misses        783      783           
Files with missing lines Coverage Δ
src/zarr/storage/_fsspec.py 91.32% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@d-v-b d-v-b added the bug Potential issues with the zarr-python library label Apr 23, 2026
@TomNicholas
Copy link
Copy Markdown
Member

Confirmed this branch fixes the downstream failure I was seeing in VirtualiZarr (zarr-developers/VirtualiZarr#957 (comment))

@TomNicholas
Copy link
Copy Markdown
Member

@davis Bennett the CI seems to be stuck here somehow? Any chance we could just yolo merge this in now so that I can keep on testing VZ against zarr-python 3.2.0's new features?

@d-v-b
Copy link
Copy Markdown
Contributor Author

d-v-b commented Apr 23, 2026

Any chance we could just yolo merge this in now so that I can keep on testing VZ against zarr-python 3.2.0's new features?

I can't self-merge PRs, so we need another dev to approve it.

@TomNicholas
Copy link
Copy Markdown
Member

oh look at that 😉

@d-v-b d-v-b merged commit 029c376 into zarr-developers:main Apr 24, 2026
28 checks passed
d-v-b added a commit that referenced this pull request Apr 29, 2026
* fix(storage): preserve leading slashes in FsspecStore.path

#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 #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>

* docs: changelog name

* docs: remove redundant changelog entries

* fix: restore old path normalization logic, and add regression tests

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Potential issues with the zarr-python library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression: FsspecStore over ReferenceFileSystem fails with GroupNotFoundError (path '/' joined as '//key')

3 participants