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

fix dataset_id error on Windows #239

Merged
merged 1 commit into from
Sep 2, 2024

Conversation

kaixin96
Copy link
Contributor

@kaixin96 kaixin96 commented Sep 2, 2024

Description

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
Screenshot 2024-09-02 193110

After
image

Checklist:

  • 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.
  • 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

Copy link
Member

@younik younik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@younik younik merged commit 7b08029 into Farama-Foundation:main Sep 2, 2024
5 of 6 checks passed
@kaixin96 kaixin96 deleted the fix-dataset-id-on-windows branch September 2, 2024 16:28
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.

[Bug Report] dataset_id with namespace doesn't match the pattern DATASET_ID_RE on Windows
2 participants