fsspec / fsspec/filesystem_spec

`async_wrapper` protocol yields `ModuleNotFoundError`

Open
#1,822 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.4k
Forks
490
Avg merge
2d 3h
Merged PRs (30d)
38

Description

Trying to use the async_wrapper with url_to_fs to build an asynchronouos filesystem like:

fsspec.url_to_fs("async_wrapper://simplecache://https://www.foo.de")

It gives me a ModuleNotFoundError:

Traceback (most recent call last):
  File "/home/nils/projects/filesystem_spec/fsspec/registry.py", line 249, in get_filesystem_class
    register_implementation(protocol, _import_class(bit["class"]))
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nils/projects/filesystem_spec/fsspec/registry.py", line 284, in _import_class
    mod = importlib.import_module(mod)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1324, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'fsspec.asyn_wrapper'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/nils/projects/filesystem_spec/fsspec/core.py", line 403, in url_to_fs
    chain = _un_chain(url, kwargs)
            ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nils/projects/filesystem_spec/fsspec/core.py", line 351, in _un_chain
    cls = get_filesystem_class(protocol)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nils/projects/filesystem_spec/fsspec/registry.py", line 251, in get_filesystem_class
    raise ImportError(bit.get("err")) from e
ImportError: None

I tested with the up-to-date master branch (2025.3.2.post1+gaa1a301)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with fsspec/core.py at url_to_fs and _un_chain, then trace protocol loading through fsspec/registry.py at get_filesystem_class and _import_class. Reproduce the async_wrapper URL example and verify that it resolves the protocol without ModuleNotFoundError and supports the intended asynchronous filesystem chain.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.