ReferenceFileSystem: use fs.open instead of fs._open #823
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.
There is a bug in
fsspec==2024.12.0
that causes theReferenceFileSystem
to incorrectly makefs._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
intests/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 thedatasets
library.The
datasets
library is only installed as part of thehf
andtests
extras, so the default installation ofdatachain
will encounter this issue.How has this been tested?
I have tested this PR with older and newer version of fsspec and the test passes on both. And the test fails with the latest version of fsspec without this patch.
Fixes #806.