Changed how to retrieve dataset_id from the path when listing local datasets. Previously, a string returned by os.path.join will be appended to the dataset_ids. However, this would break on Windows as Windows paths use backslash. Such dataset_id doesn't match the required pattern. This fix wraps the path string with pathlib.PurePath and converts it to posix path.
Fixes #238.
Type of change
Bug fix (non-breaking change which fixes an issue)
Screenshots
Before
After
Checklist:
[x] I have run the pre-commit checks with pre-commit run --all-files (see CONTRIBUTING.md instructions to set it up)
[ ] I have run pytest -v and no errors are present.
[x] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation
[ ] I solved any possible warnings that pytest -v has generated that are related to my code to the best of my knowledge.
[ ] I have added tests that prove my fix is effective or that my feature works
[ ] New and existing unit tests pass locally with my changes
Description
Changed how to retrieve
dataset_id
from the path when listing local datasets. Previously, a string returned byos.path.join
will be appended to thedataset_ids
. However, this would break on Windows as Windows paths use backslash. Suchdataset_id
doesn't match the required pattern. This fix wraps the path string withpathlib.PurePath
and converts it to posix path.Fixes #238.
Type of change
Screenshots
Before
After
Checklist:
pre-commit
checks withpre-commit run --all-files
(seeCONTRIBUTING.md
instructions to set it up)pytest -v
and no errors are present.pytest -v
has generated that are related to my code to the best of my knowledge.