Repository navigation
fix: honor storage_options in save and save_group - #4415
Merged
d-v-b merged 4 commits intoSep 29, 2026
Merged
Conversation
`save` did not declare `storage_options`, so it landed in `**kwargs` and was counted as one of the arrays to save. Passing it turned a single array into a group holding `arr_0`, and the options never reached the store. `save_group` resolved the store itself and then passed `storage_options` on to `save_array` for positional arrays, where `make_store_path` rejects them as unused. The keyword branch right below it already did the right thing.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4415 +/- ##
=======================================
Coverage 94.43% 94.43%
=======================================
Files 93 93
Lines 13219 13219
=======================================
Hits 12483 12483
Misses 736 736
🚀 New features to boost your workflow:
|
An fsspec URL for a sync filesystem is opened through AsyncFileSystemWrapper, which landed in fsspec 2024.12.0, and the min-deps CI job pins an older one. Same guard the fsspec store tests already use.
Assisted-by: ClaudeCode:claude-opus-5-5
d-v-b
approved these changes
Sep 29, 2026
Contributor
|
thanks @Rodrigo-Palma |
d-v-b
enabled auto-merge (squash)
September 29, 2026 15:23
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
save()never declaredstorage_options, so it arrived through**kwargs. Insave(),**kwargsare the arrays to write, which caused two separate problems.First,
save(store, arr, storage_options=...)no longer took the single-array branch, because that branch requireslen(kwargs) == 0. A lone array was written as a group holdingarr_0instead of as an array.Second, the option never reached the store, so an fsspec URL was opened without it.
This declares
storage_optionson both the sync and the asyncsave, forwards it tosave_arrayandsave_group, and documents it in the same words the sibling functions use.One line was also removed from
save_group: it forwardedstorage_optionsto the per-arraysave_arraycalls for positional arrays only (keyword arrays never got it). By that pointstore_pathhas already consumed the options, so forwarding them again makesmake_store_pathreject them as unused. That is theTypeErrorin the second test below.For reviewers
The removal inside
save_groupis the part worth a second look. Everything else is additive.Measured on
main, both new tests fail:On this branch
tests/test_api.pyis 355 passed, 9 skipped (CuPy not installed), andruff check,ruff format --checkandmypyare clean on the touched files.Author attestation
TODO
docs/user-guide/*.md(bug fix, no user-guide change)changes/