Skip to content

fix(storage): avoid passing asynchronous=True to sync fsspec filesystems - #4705

Open
udayraj1238 wants to merge 1 commit into
zarr-developers:mainfrom
udayraj1238:fix/fsspec-sync-from-url
Open

udayraj1238 wants to merge 1 commit into
zarr-developers:mainfrom
udayraj1238:fix/fsspec-sync-from-url

Conversation

@udayraj1238

Copy link
Copy Markdown

Closes #3576

Summary

  • Update FsspecStore.from_url (src/zarr/storage/_fsspec.py) to inspect the outermost filesystem class via fsspec.core.split_protocol and fsspec.registry.get_filesystem_class before passing storage_options to url_to_fs.
  • Only default "asynchronous": True when the filesystem class has async_impl = True (using opts.setdefault("asynchronous", True) on a shallow copy so caller options are never mutated or overwritten).
  • Synchronous filesystems such as SFTPFileSystem (ssh://, sftp://), which forward keyword arguments to paramiko.SSHClient.connect(), no longer receive an unexpected asynchronous=True keyword argument and are wrapped with _make_async(fs) as intended.
  • Add unit tests in tests/test_store/test_fsspec.py covering ssh:// (paramiko.SSHClient.connect signature verification), direct sync protocols, chained URLs (simplecache::<sync_proto>://...), explicit storage_options={"protocol": ...}, async filesystems, and preserving explicit storage_options={"asynchronous": False}.
  • Add changelog fragment changes/3576.bugfix.md.

For reviewers

  • Happy for a second look at protocol resolution for chained "::" URLs vs explicit storage_options={"protocol": ...} inside FsspecStore.from_url so it stays aligned with fsspec's _un_chain / url_to_fs behavior across supported fsspec versions (>=2023.10.0).
  • Local post-edit checks run on Windows (Python 3.13.5, fsspec 2026.9.0, paramiko 5.1.0): pytest tests/test_store/test_fsspec.py tests/test_store/test_core.py --cov=zarr.storage._fsspec --cov-report=term-missing (197 passed, 14 skipped; all added lines in _fsspec.py covered), ruff check, ruff format --check on both touched files, mypy src/zarr/storage/_fsspec.py tests/test_store/test_fsspec.py (0 issues), python ci/check_changelog_entries.py, and git diff --check.

Author attestation

  • I am a human, these are my changes, and I have reviewed and understood every change and can explain why each is correct.

Disclosure: Implemented and verified with AI coding assistance (Antigravity); all code, tests, root-cause analysis, and PR notes were reviewed and validated locally by me.

TODO

  • Add unit tests and/or doctests in docstrings
  • Add docstrings and API docs for any new/modified user-facing classes and functions
  • New/modified features documented in docs/user-guide/*.md
  • Changes documented as a new file in changes/
  • GitHub Actions have all passed
  • Test coverage is 100% (Codecov passes)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Zarr over ssh fails with unexpected keyword argument

1 participant