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

remove filecheck to enable symlinks #7133

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

fschlatt
Copy link
Contributor

Enables streaming from local symlinks #7083

@lhoestq

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

src/datasets/data_files.py Outdated Show resolved Hide resolved
@lhoestq
Copy link
Member

lhoestq commented Sep 2, 2024

The CI is failing, looks like it breaks imagefolder loading.

I just checked fsspec internals and maybe instead we can detect symlink by checking islink and size to make sure it's a file

if info["type"] == "file" or (info.get("islink") and info["size"])

@lhoestq
Copy link
Member

lhoestq commented Sep 2, 2024

hmm actually size doesn't seem to filter symlinked directories, we need another way

@fschlatt
Copy link
Contributor Author

fschlatt commented Sep 3, 2024

Does fsspec perhaps allow resolving symlinks? Something like https://docs.python.org/3/library/pathlib.html#pathlib.Path.resolve

@lhoestq
Copy link
Member

lhoestq commented Sep 4, 2024

there is info["destination"] in case of a symlink, so maybe

if info["type"] == "file" or (info.get("islink") and info.get("destination") and os.path.isfile(info["destination"]))

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.

3 participants