Skip to content

Commit

Permalink
Remove arrow_io_source (#16607)
Browse files Browse the repository at this point in the history
The `arrow_io_source` in libcudf only existed to support Python's pyarrow NativeFile integration, which was deprecated and removed in #16589.

Authors:
  - Vyas Ramasubramani (https://github.com/vyasr)

Approvers:
  - Thomas Li (https://github.com/lithomas1)
  - Bradley Dice (https://github.com/bdice)
  - Yunsong Wang (https://github.com/PointKernel)

URL: #16607
  • Loading branch information
vyasr authored Aug 20, 2024
1 parent 3f6dd14 commit a45af4a
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 353 deletions.
1 change: 0 additions & 1 deletion cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,6 @@ add_library(
src/io/text/bgzip_data_chunk_source.cu
src/io/text/bgzip_utils.cpp
src/io/text/multibyte_split.cu
src/io/utilities/arrow_io_source.cpp
src/io/utilities/base64_utilities.cpp
src/io/utilities/column_buffer.cpp
src/io/utilities/column_buffer_strings.cu
Expand Down
93 changes: 0 additions & 93 deletions cpp/include/cudf/io/arrow_io_source.hpp

This file was deleted.

87 changes: 0 additions & 87 deletions cpp/src/io/utilities/arrow_io_source.cpp

This file was deleted.

4 changes: 0 additions & 4 deletions cpp/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,6 @@ ConfigureTest(
ConfigureTest(JSON_WRITER_TEST io/json/json_writer.cpp)
ConfigureTest(JSON_TYPE_CAST_TEST io/json/json_type_cast_test.cu)
ConfigureTest(NESTED_JSON_TEST io/json/nested_json_test.cpp io/json/json_tree.cpp)
ConfigureTest(ARROW_IO_SOURCE_TEST io/arrow_io_source_test.cpp)
ConfigureTest(MULTIBYTE_SPLIT_TEST io/text/multibyte_split_test.cpp)
ConfigureTest(JSON_QUOTE_NORMALIZATION io/json/json_quote_normalization_test.cpp)
ConfigureTest(JSON_WHITESPACE_NORMALIZATION io/json/json_whitespace_normalization_test.cu)
Expand All @@ -334,9 +333,6 @@ target_link_libraries(DATA_CHUNK_SOURCE_TEST PRIVATE ZLIB::ZLIB)
ConfigureTest(LOGICAL_STACK_TEST io/fst/logical_stack_test.cu)
ConfigureTest(FST_TEST io/fst/fst_test.cu)
ConfigureTest(TYPE_INFERENCE_TEST io/type_inference_test.cu)
if(CUDF_ENABLE_ARROW_S3)
target_compile_definitions(ARROW_IO_SOURCE_TEST PRIVATE "S3_ENABLED")
endif()

# ##################################################################################################
# * sort tests ------------------------------------------------------------------------------------
Expand Down
103 changes: 0 additions & 103 deletions cpp/tests/io/arrow_io_source_test.cpp

This file was deleted.

26 changes: 1 addition & 25 deletions cpp/tests/io/csv_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@

#include <cudf/detail/iterator.cuh>
#include <cudf/fixed_point/fixed_point.hpp>
#include <cudf/io/arrow_io_source.hpp>
#include <cudf/io/csv.hpp>
#include <cudf/io/datasource.hpp>
#include <cudf/strings/convert/convert_datetime.hpp>
#include <cudf/strings/convert/convert_fixed_point.hpp>
#include <cudf/strings/strings_column_view.hpp>
Expand Down Expand Up @@ -1197,30 +1197,6 @@ TEST_F(CsvReaderTest, HeaderOnlyFile)
EXPECT_EQ(3, view.num_columns());
}

TEST_F(CsvReaderTest, ArrowFileSource)
{
auto filepath = temp_env->get_temp_dir() + "ArrowFileSource.csv";
{
std::ofstream outfile(filepath, std::ofstream::out);
outfile << "A\n9\n8\n7\n6\n5\n4\n3\n2\n";
}

std::shared_ptr<arrow::io::ReadableFile> infile;
ASSERT_TRUE(arrow::io::ReadableFile::Open(filepath).Value(&infile).ok());

auto arrow_source = cudf::io::arrow_io_source{infile};
cudf::io::csv_reader_options in_opts =
cudf::io::csv_reader_options::builder(cudf::io::source_info{&arrow_source})
.dtypes({dtype<int8_t>()});
auto result = cudf::io::read_csv(in_opts);

auto const view = result.tbl->view();
EXPECT_EQ(1, view.num_columns());
ASSERT_EQ(type_id::INT8, view.column(0).type().id());

expect_column_data_equal(std::vector<int8_t>{9, 8, 7, 6, 5, 4, 3, 2}, view.column(0));
}

TEST_F(CsvReaderTest, InvalidFloatingPoint)
{
auto const filepath = temp_env->get_temp_dir() + "InvalidFloatingPoint.csv";
Expand Down
26 changes: 0 additions & 26 deletions cpp/tests/io/json/json_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include <cudf_test/type_lists.hpp>

#include <cudf/detail/iterator.cuh>
#include <cudf/io/arrow_io_source.hpp>
#include <cudf/io/json.hpp>
#include <cudf/strings/convert/convert_fixed_point.hpp>
#include <cudf/strings/repeat_strings.hpp>
Expand Down Expand Up @@ -958,31 +957,6 @@ TEST_F(JsonReaderTest, NoDataFileValues)
EXPECT_EQ(0, view.num_columns());
}

TEST_F(JsonReaderTest, ArrowFileSource)
{
const std::string fname = temp_env->get_temp_dir() + "ArrowFileSource.csv";

std::ofstream outfile(fname, std::ofstream::out);
outfile << "[9]\n[8]\n[7]\n[6]\n[5]\n[4]\n[3]\n[2]\n";
outfile.close();

std::shared_ptr<arrow::io::ReadableFile> infile;
ASSERT_TRUE(arrow::io::ReadableFile::Open(fname).Value(&infile).ok());

auto arrow_source = cudf::io::arrow_io_source{infile};
cudf::io::json_reader_options in_options =
cudf::io::json_reader_options::builder(cudf::io::source_info{&arrow_source})
.dtypes({dtype<int8_t>()})
.lines(true);

cudf::io::table_with_metadata result = cudf::io::read_json(in_options);

EXPECT_EQ(result.tbl->num_columns(), 1);
EXPECT_EQ(result.tbl->get_column(0).type().id(), cudf::type_id::INT8);

CUDF_TEST_EXPECT_COLUMNS_EQUAL(result.tbl->get_column(0), int8_wrapper{{9, 8, 7, 6, 5, 4, 3, 2}});
}

TEST_P(JsonReaderParamTest, InvalidFloatingPoint)
{
auto const test_opt = GetParam();
Expand Down
Loading

0 comments on commit a45af4a

Please sign in to comment.