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 ClassLabel to/from dict when passed names_file #3695

Merged
merged 3 commits into from
Feb 11, 2022
Merged

Conversation

albertvillanova
Copy link
Member

Currently, names_file is a field of the data class ClassLabel, thus appearing when transforming it to dict (when saving infos). Afterwards, when trying to read it from infos, it conflicts with the other field names.

This PR, removes names_file as a field of the data class ClassLabel.

  • it is only used at instantiation to generate the labels field

Fix #3631.

Copy link
Member

@lhoestq lhoestq left a comment

Choose a reason for hiding this comment

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

Great thanks ! I think we can also add a comment to explain that:

src/datasets/features/features.py Outdated Show resolved Hide resolved
@albertvillanova albertvillanova merged commit b150e58 into master Feb 11, 2022
@albertvillanova albertvillanova deleted the fix-3631 branch February 11, 2022 23:02
albertvillanova added a commit that referenced this pull request Mar 7, 2022
* Test ClassLabel to/from dict with names_file

* Fix ClassLabel to/from dict with names_file

* Add explanatory comment
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.

Labels conflict when loading a local CSV file.
2 participants