Skip to content

Commit

Permalink
remove column_names usage (ref rapidsai#12578)
Browse files Browse the repository at this point in the history
  • Loading branch information
karthikeyann committed Jan 19, 2023
1 parent cd73d75 commit 1c6821d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
10 changes: 1 addition & 9 deletions cpp/src/io/json/write_json.cu
Original file line number Diff line number Diff line change
Expand Up @@ -650,15 +650,7 @@ void write_json(data_sink* out_sink,
{
std::vector<column_name_info> user_column_names = [&]() {
auto const& metadata = options.get_metadata();
if (metadata.has_value() and not metadata->column_names.empty()) {
auto const& column_names = metadata->column_names;
std::vector<column_name_info> names;
std::transform(
column_names.begin(), column_names.end(), std::back_inserter(names), [](auto const& name) {
return column_name_info{name};
});
return names;
} else if (metadata.has_value() and not metadata->schema_info.empty()) {
if (metadata.has_value() and not metadata->schema_info.empty()) {
return metadata->schema_info;
} else {
std::vector<column_name_info> names;
Expand Down
3 changes: 2 additions & 1 deletion cpp/tests/io/json_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ TEST_F(JsonWriterTest, PlainTable)
cudf::test::iterators::nulls_at({0, 2})};
cudf::table_view tbl_view{{col1, col2, col3, col4, col5}};
std::vector<std::string> column_names{"col1", "col2", "int", "float", "int16"};
cudf::io::table_metadata mt{column_names};
cudf::io::table_metadata mt;
std::copy(column_names.begin(), column_names.end(), std::back_inserter(mt.schema_info));

std::vector<char> out_buffer;
auto destination = cudf::io::sink_info(&out_buffer);
Expand Down

0 comments on commit 1c6821d

Please sign in to comment.