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

Correctly update metadata to preserve features when concatenating datasets with axis=1 #3120

Merged
merged 2 commits into from
Oct 21, 2021

Conversation

mariosasko
Copy link
Collaborator

This PR correctly updates metadata to preserve higher-level feature types (e.g. ClassLabel) in datasets.concatenate_datasets when axis=1. Previously, we would delete the feature metadata in datasets.concatenate_datasets if axis=1 and restore the feature types from the arrow table schema in Dataset.__init__. However, this approach only works for simple feature types (e.g. Value).

Fixes #3111

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 @mariosasko. And also thanks for the test!

@albertvillanova albertvillanova changed the title Correctly update metadata to preserve features when concatenating datasets with axis == 1 Correctly update metadata to preserve features when concatenating datasets with axis=1 Oct 21, 2021
@albertvillanova albertvillanova merged commit 2f311fb into huggingface:master Oct 21, 2021
@mariosasko mariosasko deleted the fix-3111 branch October 22, 2021 08: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.

concatenate_datasets removes ClassLabel typing.
2 participants