Skip to content

Conversation

@riccardobucco
Copy link
Contributor

@riccardobucco riccardobucco commented Oct 17, 2022

Fix #5098

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

@albertvillanova albertvillanova changed the title Fix class name of symbolic link (#5098) Fix class name of symbolic link Oct 18, 2022
@albertvillanova
Copy link
Member

albertvillanova commented Oct 18, 2022

I have removed the reference to the Issue in the PR title, so that we avoid to have both references (to the issue and to the PR) in the merge commit to the main branch.

Instead, it should be commented in the PR description, so that the PR is appropriately linked by GitHub to its corresponding Issue:

Fix #5098.

Copy link
Member

@albertvillanova albertvillanova left a comment

Choose a reason for hiding this comment

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

Thanks for the fix, @riccardobucco.

Could you please implement a regression test as well? This is considered a good practice in software development.

@riccardobucco
Copy link
Contributor Author

@albertvillanova What should I test in your opinion? Also, where should I save the test file and how should I name it? Thanks for your support

@albertvillanova
Copy link
Member

albertvillanova commented Oct 18, 2022

The regression test to be implemented should test what your PR fixes: that is, that _resolve_single_pattern_locally function does not resolve any symbolic link when passed a directory that does contain any.

As you are testing a function in data_files.py, the corresponding test should be in tests/test_data_files.py.

You could name the test something lilke: test_resolve_single_pattern_locally_does_not_resolve_symbolic_links

You could take inspiration from other tests there in that file.

Copy link
Member

@albertvillanova albertvillanova left a comment

Choose a reason for hiding this comment

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

Thanks @riccardobucco for having tried, and thanks @mariosasko for the proposal of the fix solution (#5098 (comment)) and the addition of the regression test (d5f135a).

@mariosasko mariosasko merged commit 1b81805 into huggingface:main Nov 14, 2022
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.

Classes label error when loading symbolic links using imagefolder

4 participants