Skip to content

Commit

Permalink
reverted c++ test in favor of python test
Browse files Browse the repository at this point in the history
  • Loading branch information
elstehle committed Jun 16, 2021
1 parent 0c67f2e commit 3c9e6df
Showing 1 changed file with 0 additions and 42 deletions.
42 changes: 0 additions & 42 deletions cpp/tests/io/csv_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1081,48 +1081,6 @@ TEST_F(CsvReaderTest, ArrowFileSource)
expect_column_data_equal(std::vector<int8_t>{9, 8, 7, 6, 5, 4, 3, 2}, view.column(0));
}

TEST_F(CsvReaderTest, ZippedCSV)
{
// input is the following CSV zip'ed:
// "year,name,description\n1997,Ford,"Super, luxurious truck"\n1997,Ford,"Super, luxurious truck"
constexpr uint8_t compressed[] = {
0x50, 0x4b, 0x03, 0x04, 0x14, 0x00, 0x00, 0x00, 0x08, 0x00, 0x4e, 0x5b, 0xcf, 0x52, 0xaf, 0x6f,
0xfa, 0xe1, 0x3c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x1c, 0x00, 0x7a, 0x69,
0x70, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x73, 0x76, 0x55, 0x54, 0x09, 0x00,
0x03, 0x44, 0x72, 0xc8, 0x60, 0x45, 0x72, 0xc8, 0x60, 0x75, 0x78, 0x0b, 0x00, 0x01, 0x04, 0xf7,
0x01, 0x00, 0x00, 0x04, 0x14, 0x00, 0x00, 0x00, 0xab, 0x4c, 0x4d, 0x2c, 0xd2, 0xc9, 0x4b, 0xcc,
0x4d, 0xd5, 0x49, 0x49, 0x2d, 0x4e, 0x2e, 0xca, 0x2c, 0x28, 0xc9, 0xcc, 0xcf, 0xe3, 0x32, 0xb4,
0xb4, 0x34, 0xd7, 0x71, 0xcb, 0x2f, 0x4a, 0xd1, 0x51, 0x0a, 0x2e, 0x2d, 0x48, 0x2d, 0xd2, 0x51,
0xc8, 0x29, 0xad, 0x28, 0x2d, 0xca, 0xcc, 0x2f, 0x2d, 0x56, 0x28, 0x29, 0x2a, 0x4d, 0xce, 0x56,
0x22, 0x46, 0x09, 0x00, 0x50, 0x4b, 0x01, 0x02, 0x1e, 0x03, 0x14, 0x00, 0x00, 0x00, 0x08, 0x00,
0x4e, 0x5b, 0xcf, 0x52, 0xaf, 0x6f, 0xfa, 0xe1, 0x3c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00,
0x0e, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xa4, 0x81, 0x00, 0x00,
0x00, 0x00, 0x7a, 0x69, 0x70, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x73, 0x76,
0x55, 0x54, 0x05, 0x00, 0x03, 0x44, 0x72, 0xc8, 0x60, 0x75, 0x78, 0x0b, 0x00, 0x01, 0x04, 0xf7,
0x01, 0x00, 0x00, 0x04, 0x14, 0x00, 0x00, 0x00, 0x50, 0x4b, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00,
0x01, 0x00, 0x01, 0x00, 0x54, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00,
};

const auto filepath = temp_env->get_temp_dir() + "zipped_example.zip";
{
std::ofstream outfile(filepath, std::ofstream::out | std::ofstream::binary);
outfile.write(reinterpret_cast<const char*>(compressed), sizeof(compressed));
}

cudf_io::csv_reader_options in_opts =
cudf_io::csv_reader_options::builder(cudf_io::source_info{filepath})
.compression(cudf::io::compression_type::ZIP);
const auto result = cudf_io::read_csv(in_opts);
const auto result_view = result.tbl->view();

auto year_col = std::vector<int64_t>{1997L, 1997L};
auto name_col = std::vector<std::string>{"Ford", "Ford"};
auto descr_col = std::vector<std::string>{"Super, luxurious truck", "Super, luxurious truck"};
expect_column_data_equal(year_col, result_view.column(0));
expect_column_data_equal(name_col, result_view.column(1));
expect_column_data_equal(descr_col, result_view.column(2));
}

TEST_F(CsvReaderTest, InvalidFloatingPoint)
{
const auto filepath = temp_env->get_temp_dir() + "InvalidFloatingPoint.csv";
Expand Down

0 comments on commit 3c9e6df

Please sign in to comment.