-
Notifications
You must be signed in to change notification settings - Fork 571
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
Transfer the hffs
code to hfh
#1420
Conversation
The documentation is not available anymore as the PR was closed or merged. |
Cc @stevhliu for the docs review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, this looks great! 👍
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on that @mariosasko! I left some comments to fix but mostly cosmetic. Nothing to change logic-wise. Really looking forward to get this merged and released! 🎉
out = set() | ||
path = [self._strip_protocol(p) for p in path] | ||
for p in path: | ||
if has_magic(p): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never used this method, what is it doing? (it doesn't seem to be documented in the official docs 😕)
Co-authored-by: Lucain <lucainp@gmail.com>
Ready for the final review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Final approval from me!
I made a small update to rename ResolvedPath
to HfFileSystemResolvedPath
to make it more explicitly hffs-related. It shouldn't be used by the user anyway but since it's exposed at root-level it's best to be explicit IMO.
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #1420 +/- ##
===========================================
+ Coverage 54.55% 84.36% +29.80%
===========================================
Files 48 49 +1
Lines 5006 5238 +232
===========================================
+ Hits 2731 4419 +1688
+ Misses 2275 819 -1456
... and 32 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
For some reason those are not working: This one raises FileNotFoundError but it's maybe normal - we expect unquoted revisions as params >>> fs.ls("datasets/lhoestq/demo1", revision="refs%2Fconvert%2Fparquet")
File ~/.pyenv/versions/3.9.15/envs/hf-datasets/lib/python3.9/site-packages/huggingface_hub/hf_file_system.py:168, in HfFileSystem.resolve_path(self, path, revision)
166 raise FileNotFoundError(path) from err
167 else:
--> 168 raise FileNotFoundError(path) from err
169 else:
170 repo_id = path
FileNotFoundError: lhoestq/demo1 but those one should work IMO: >>> fs.ls("datasets/lhoestq/demo1", revision="refs/convert/parquet")
File ~/.pyenv/versions/3.9.15/envs/hf-datasets/lib/python3.9/site-packages/huggingface_hub/hf_file_system.py:120, in HfFileSystem.resolve_path.<locals>._align_revision_in_path_with_revision(revision_in_path, revision)
118 if revision is not None:
119 if revision_in_path is not None and revision_in_path != revision:
--> 120 raise ValueError(
121 f'Revision specified in path ("{revision_in_path}") and in `revision` argument ("{revision}")'
122 " are not the same."
123 )
124 else:
125 revision = revision_in_path
ValueError: Revision specified in path ("refs") and in `revision` argument ("refs/convert/parquet") are not the same. >>> fs.ls("datasets/lhoestq/demo1@refs%2Fconvert%2Fparquet")
File ~/.pyenv/versions/3.9.15/envs/hf-datasets/lib/python3.9/site-packages/huggingface_hub/hf_file_system.py:120, in HfFileSystem.resolve_path.<locals>._align_revision_in_path_with_revision(revision_in_path, revision)
118 if revision is not None:
119 if revision_in_path is not None and revision_in_path != revision:
--> 120 raise ValueError(
121 f'Revision specified in path ("{revision_in_path}") and in `revision` argument ("{revision}")'
122 " are not the same."
123 )
124 else:
125 revision = revision_in_path
ValueError: Revision specified in path ("refs") and in `revision` argument ("refs/convert/parquet") are not the same. while it does exist on the Hub: https://huggingface.co/datasets/lhoestq/demo1/tree/refs%2Fconvert%2Fparquet |
Yes, we want to be consistent with |
Transfers the
hffs
code (and documentation from huggingface/hffs#13) tohfh
.The CI failures seem unrelated.