Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArrowGenerator is broken on caching with latest fsspec release #806

Closed
skshetry opened this issue Jan 9, 2025 · 1 comment · Fixed by #823
Closed

ArrowGenerator is broken on caching with latest fsspec release #806

skshetry opened this issue Jan 9, 2025 · 1 comment · Fixed by #823
Assignees
Labels
bug Something isn't working

Comments

@skshetry
Copy link
Member

skshetry commented Jan 9, 2025

Description

Broken by fsspec/filesystem_spec#1755.

Traceback (most recent call last):]
  File "/Users/user/work/iterative/datachain/src/datachain/lib/arrow.py", line 90, in iter_records
    for record_batch in ds.to_batches(**kw):
                        ^^^^^^^^^^^^^^^^^^^
AttributeError: 'coroutine' object has no attribute 'closed'
/Users/user/work/iterative/datachain/src/datachain/lib/arrow.py:90: RuntimeWarning: coroutine 'AbstractFileSystem.open' was never awaited
  for record_batch in ds.to_batches(**kw):

Thanks to @dreadatour for catching the bug.

Version Info


@skshetry skshetry added the bug Something isn't working label Jan 9, 2025
@skshetry skshetry self-assigned this Jan 9, 2025
@skshetry skshetry changed the title ArrowGenerator is broken on caching on latest fsspec release ArrowGenerator is broken on caching with latest fsspec release Jan 9, 2025
@shcheklein
Copy link
Member

@skshetry it seems like a major issue, what it the solution for this? should we for now pin the previous version?

skshetry added a commit that referenced this issue Jan 16, 2025
There is a bug in `fsspec==2024.12.0` that causes the `ReferenceFileSystem` to
incorrectly make `fs._open` return a coroutine object instead of a file-like object.
(See a proposed PR to fix this issue: fsspec/filesystem_spec#1769.)

We have a test for the expected behavior (`test_arrow_generator_partitioned` in `tests/unit/lib/test_arrow.py`)
running in the CI environment.
But that does not fail because the latest version of `fsspec` does not get installed in the CI
due to the upper limit set by the `datasets` library.

The `datasets` library is only installed as part of the `hf` and `tests` extras,
so the default installation of `datachain` will encounter this issue.

Fixes #806.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants