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

Preserve non-input_colums in Dataset.map if input_columns are specified #4971

Merged
merged 3 commits into from Sep 13, 2022

Conversation

mariosasko
Copy link
Contributor

Currently, if the input_columns list in Dataset.map is specified, the columns not in that list are dropped after the map transform.

This makes the behavior inconsistent with IterableDataset.map.

(It seems this issue was introduced by mistake in #2246)

Fix #4858

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Sep 12, 2022

The documentation is not available anymore as the PR was closed or merged.

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.

Good catch. Thanks.

tests/test_arrow_dataset.py Outdated Show resolved Hide resolved
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.

Thanks !

tests/test_arrow_dataset.py Show resolved Hide resolved
src/datasets/arrow_dataset.py Outdated Show resolved Hide resolved
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.

LGTM !

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.

map() function removes columns when input_columns is not None
4 participants