close
The Wayback Machine - https://web.archive.org/web/20201113173223/https://github.com/rapidsai/cudf/issues/6669
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

[BUG] CSV Writer ignores the header parameter when no metadata is provided #6669

Open
vuule opened this issue Nov 4, 2020 · 0 comments
Open

[BUG] CSV Writer ignores the header parameter when no metadata is provided #6669

vuule opened this issue Nov 4, 2020 · 0 comments

Comments

@vuule
Copy link
Collaborator

@vuule vuule commented Nov 4, 2020

CSV writer doesn't include column names if metadata is not present, even if header parameter is set to true.

The CSV reader automatically generates column names if input does not have a header. Thus, current writer behavior causes the first row to be read as column names when using default parameters for both reading and writing:

  cudf_io::csv_writer_options writer_options =
    cudf_io::csv_writer_options::builder(cudf_io::sink_info{"issue.csv"}, table);
  cudf_io::write_csv(writer_options);

  cudf_io::csv_reader_options read_options =
    cudf_io::csv_reader_options::builder(udf_io::source_info{"issue.csv"});
  cudf_io::read_csv(read_options);

The APIs should work well with default parameters.

Note: this behavior is never exercised in tests because all write_csv tests use write_csv_helper, which always sets the metadata.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.