Conversation
WellDataset built data_path, trunk_path and the default normalization_path with os.path.join, which inserts backslashes on Windows and turns hf:// URIs into invalid Hugging Face repo ids. Join remote (fsspec) paths with posixpath instead, and treat a remote normalization_path as absolute. Fixes PolymathicAI#91
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #91.
WellDatasetbuiltdata_path,trunk_pathand the defaultnormalization_pathwithos.path.join. On Windows that inserts backslashes, sohf://datasets/polymathic-ai/becomes an invalid Hugging Face repo id and streaming fails.Changes:
_join_pathhelper that usesposixpath.joinwhen the base path is an fsspec URI (contains://) andos.path.joinotherwise. Use it for every join inWellDataset.__init__(same class of fix as Fix Windows path resolution for normalization_path #81, extended to the data paths).normalization_pathas absolute instead of re-joining it under the trunk path.os.pathforntpathto simulate Windows and checks that remote URIs keep forward slashes while local paths still use the platform separator.pytest tests/data/test_dataset.py: 29 passed.