From 4088c85f8cbd87f05206bfbd06ddc64aacb6e3a5 Mon Sep 17 00:00:00 2001 From: Matt Topol Date: Thu, 21 Nov 2024 15:47:09 -0500 Subject: [PATCH 1/2] Fix Debug-mode failing Arrow test --- cpp/tests/interop/arrow_utils.hpp | 3 +-- cpp/tests/interop/from_arrow_test.cpp | 7 ++++++- cpp/tests/interop/to_arrow_test.cpp | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/cpp/tests/interop/arrow_utils.hpp b/cpp/tests/interop/arrow_utils.hpp index 70a9fe64d70d..e785845394ad 100644 --- a/cpp/tests/interop/arrow_utils.hpp +++ b/cpp/tests/interop/arrow_utils.hpp @@ -212,9 +212,8 @@ std::shared_ptr get_arrow_list_array(std::vector data, "Failed to append values to buffer builder"); CUDF_EXPECTS(buff_builder.Finish(&offset_buffer).ok(), "Failed to allocate buffer"); - auto nullable = std::accumulate(list_validity.begin(), list_validity.end(), 0) > 0; return std::make_shared( - arrow::list(arrow::field("", data_array->type(), nullable)), + arrow::list(arrow::field("element", data_array->type(), data_array->null_count() > 0)), offsets.size() - 1, offset_buffer, data_array, diff --git a/cpp/tests/interop/from_arrow_test.cpp b/cpp/tests/interop/from_arrow_test.cpp index 18efae75cb15..567462d3b169 100644 --- a/cpp/tests/interop/from_arrow_test.cpp +++ b/cpp/tests/interop/from_arrow_test.cpp @@ -36,6 +36,8 @@ #include +#include + std::unique_ptr get_cudf_table() { std::vector> columns; @@ -279,7 +281,10 @@ TEST_F(FromArrowTest, StructColumn) auto list_arr = get_arrow_list_array({1, 2, 3, 4, 5, 6, 7, 8, 9}, {0, 2, 4, 5, 6, 7, 9}); std::vector offset{0, 3, 4, 6}; auto nested_list_arr = std::make_shared( - arrow::list(list(arrow::int64())), offset.size() - 1, arrow::Buffer::Wrap(offset), list_arr); + arrow::list(list(arrow::field("element", arrow::int64(), false))), + offset.size() - 1, + arrow::Buffer::Wrap(offset), + list_arr); std::vector> child_arrays2({str2_array, int2_array}); auto fields2 = std::vector>{ diff --git a/cpp/tests/interop/to_arrow_test.cpp b/cpp/tests/interop/to_arrow_test.cpp index 86295d8efb16..faa07ba33112 100644 --- a/cpp/tests/interop/to_arrow_test.cpp +++ b/cpp/tests/interop/to_arrow_test.cpp @@ -261,14 +261,14 @@ TEST_F(ToArrowTest, NestedList) std::vector offset{0, 0, 2}; auto mask_buffer = arrow::internal::BytesToBits({0, 1}).ValueOrDie(); auto nested_list_arr = std::make_shared( - arrow::list(arrow::field("a", arrow::list(arrow::int64()), false)), + arrow::list(arrow::field("element", arrow::list(arrow::int64()), false)), offset.size() - 1, arrow::Buffer::Wrap(offset), list_arr, mask_buffer); std::vector> schema_vector( - {arrow::field("a", nested_list_arr->type())}); + {arrow::field("a", nested_list_arr->type(), false)}); auto schema = std::make_shared(schema_vector); auto expected_arrow_table = arrow::Table::Make(schema, {nested_list_arr}); From a60a92f0997cede52c581a65a720a2beb9311cc1 Mon Sep 17 00:00:00 2001 From: Matt Topol Date: Thu, 21 Nov 2024 15:48:54 -0500 Subject: [PATCH 2/2] remove unused iostream --- cpp/tests/interop/from_arrow_test.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/cpp/tests/interop/from_arrow_test.cpp b/cpp/tests/interop/from_arrow_test.cpp index 567462d3b169..62e38cbfd456 100644 --- a/cpp/tests/interop/from_arrow_test.cpp +++ b/cpp/tests/interop/from_arrow_test.cpp @@ -36,8 +36,6 @@ #include -#include - std::unique_ptr get_cudf_table() { std::vector> columns;