Skip to content

Conversation

Mytherin
Copy link
Collaborator

Implements #6003

This allows you to override only the names of a CSV file - which is useful when reading CSV files without headers but where types can be correctly inferred. Example usage:

dates.csv
1992|1|1
1993|1|1
SELECT * FROM read_csv_auto('dates.csv', names=['year', 'month', 'day']);

@Tishj perhaps you can pick this up and add it to the read_csv method in the Python client?

@Tishj
Copy link
Contributor

Tishj commented Feb 16, 2023

I've added names and also usecols to the options, changes are on this branch: https://github.com/tishj/duckdb/tree/python_read_csv_names
I'll make a PR once the CI passes :)

@Mytherin Mytherin merged commit b8b9f27 into duckdb:master Feb 16, 2023
@Mytherin Mytherin deleted the csvcolumnnames branch February 16, 2023 14:41
@Mytherin
Copy link
Collaborator Author

It is merged now

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.

2 participants