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

Add features parameter to CSV #685

Merged
merged 4 commits into from Sep 30, 2020
Merged

Conversation

lhoestq
Copy link
Member

@lhoestq lhoestq commented Sep 29, 2020

Add support for the features parameter when loading a csv dataset:

from datasets import load_dataset, Features

features = Features({...})
csv_dataset = load_dataset("csv", data_files=["path/to/my/file.csv"], features=features)

I added tests to make sure that it is also compatible with the caching system

Fix #623

Copy link
Member

@thomwolf thomwolf left a comment

Choose a reason for hiding this comment

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

Very clean!

@@ -78,6 +81,6 @@ def _generate_tables(self, files):
file,
read_options=self.config.pa_read_options,
parse_options=self.config.pa_parse_options,
convert_options=self.config.convert_options,
convert_options=self.config.pa_convert_options,
Copy link
Member

Choose a reason for hiding this comment

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

Good catch!

@lhoestq lhoestq merged commit 6460a2e into master Sep 30, 2020
@lhoestq lhoestq deleted the add-features-parameter-to-csv branch September 30, 2020 08:39
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.

Custom feature types in load_dataset from CSV
2 participants