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

Support quotes around column names in csv header row #19

Open
bostonrwalker opened this issue Nov 27, 2024 · 0 comments · May be fixed by #21
Open

Support quotes around column names in csv header row #19

bostonrwalker opened this issue Nov 27, 2024 · 0 comments · May be fixed by #21

Comments

@bostonrwalker
Copy link

DataclassReader fails to read a csv file when there are quotes around column names in header.

Example error output (notice how the column names are identical, except the file fields have quotes around them):

Traceback (most recent call last):
  File "/Users/.../main.py", line 5, in <module>
    movie = next(movies)
  File "/Users/.../movie.py", line 57, in tmdb_dataset
    reader = DataclassReader(csv_file, Movie)
  File "/Users/.../dataclass_io/dataclass_io/reader.py", line 44, in __init__
    assert_file_header_matches_dataclass(
  File "/Users/.../dataclass_io/dataclass_io/_lib/assertions.py", line 122, in assert_file_header_matches_dataclass
    raise ValueError(
ValueError: The provided file does not have the same field names as the provided dataclass:
	Dataclass: Movie
	Dataclass fields: id, title, vote_average, vote_count, status, release_date, revenue, runtime, adult, backdrop_path, budget, homepage, imdb_id, original_language, original_title, overview, popularity, poster_path, tagline, genres, production_companies, production_countries, spoken_languages, keywords
	File fields: "id","title","vote_average","vote_count","status","release_date","revenue","runtime","adult","backdrop_path","budget","homepage","imdb_id","original_language","original_title","overview","popularity","poster_path","tagline","genres","production_companies","production_countries","spoken_languages","keywords"
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 a pull request may close this issue.

1 participant