diff --git a/cpp/src/io/json/write_json.cu b/cpp/src/io/json/write_json.cu index ffb4a7cd87b..1e44522ed33 100644 --- a/cpp/src/io/json/write_json.cu +++ b/cpp/src/io/json/write_json.cu @@ -582,7 +582,7 @@ struct column_to_strings_fn { return cudf::strings::detail::from_timestamps( column, format, - strings_column_view(column_view{data_type{type_id::STRING}, 0, nullptr, nullptr, 0}), + strings_column_view(make_empty_column(type_id::STRING)->view()), stream_, mr_); } diff --git a/cpp/tests/copying/gather_str_tests.cpp b/cpp/tests/copying/gather_str_tests.cpp index 41251b028ae..22af600ab96 100644 --- a/cpp/tests/copying/gather_str_tests.cpp +++ b/cpp/tests/copying/gather_str_tests.cpp @@ -133,10 +133,9 @@ TEST_F(GatherTestStr, GatherDontCheckOutOfBounds) TEST_F(GatherTestStr, GatherEmptyMapStringsColumn) { - cudf::column_view zero_size_strings_column( - cudf::data_type{cudf::type_id::STRING}, 0, nullptr, nullptr, 0); + auto const zero_size_strings_column = cudf::make_empty_column(cudf::type_id::STRING); cudf::test::fixed_width_column_wrapper gather_map; - auto results = cudf::detail::gather(cudf::table_view({zero_size_strings_column}), + auto results = cudf::detail::gather(cudf::table_view({zero_size_strings_column->view()}), gather_map, cudf::out_of_bounds_policy::NULLIFY, cudf::detail::negative_index_policy::NOT_ALLOWED, @@ -147,11 +146,10 @@ TEST_F(GatherTestStr, GatherEmptyMapStringsColumn) TEST_F(GatherTestStr, GatherZeroSizeStringsColumn) { - cudf::column_view zero_size_strings_column( - cudf::data_type{cudf::type_id::STRING}, 0, nullptr, nullptr, 0); + auto const zero_size_strings_column = cudf::make_empty_column(cudf::type_id::STRING); cudf::test::fixed_width_column_wrapper gather_map({0}); cudf::test::strings_column_wrapper expected{std::pair{"", false}}; - auto results = cudf::detail::gather(cudf::table_view({zero_size_strings_column}), + auto results = cudf::detail::gather(cudf::table_view({zero_size_strings_column->view()}), gather_map, cudf::out_of_bounds_policy::NULLIFY, cudf::detail::negative_index_policy::NOT_ALLOWED, diff --git a/cpp/tests/reshape/interleave_columns_tests.cpp b/cpp/tests/reshape/interleave_columns_tests.cpp index e2697567c38..eba6c961bbb 100644 --- a/cpp/tests/reshape/interleave_columns_tests.cpp +++ b/cpp/tests/reshape/interleave_columns_tests.cpp @@ -189,7 +189,7 @@ struct InterleaveStringsColumnsTest : public cudf::test::BaseFixture {}; TEST_F(InterleaveStringsColumnsTest, ZeroSizedColumns) { - cudf::column_view col0(cudf::data_type{cudf::type_id::STRING}, 0, nullptr, nullptr, 0); + auto const col0 = cudf::make_empty_column(cudf::type_id::STRING)->view(); auto results = cudf::interleave_columns(cudf::table_view{{col0}}); cudf::test::expect_column_empty(results->view()); diff --git a/cpp/tests/strings/array_tests.cpp b/cpp/tests/strings/array_tests.cpp index ecc38dfd26e..c7ceb899833 100644 --- a/cpp/tests/strings/array_tests.cpp +++ b/cpp/tests/strings/array_tests.cpp @@ -47,8 +47,8 @@ TEST_F(StringsColumnTest, Sort) TEST_F(StringsColumnTest, SortZeroSizeStringsColumn) { - cudf::column_view zero_size_strings_column( - cudf::data_type{cudf::type_id::STRING}, 0, nullptr, nullptr, 0); + auto const zero_size_strings_column = cudf::make_empty_column(cudf::type_id::STRING)->view(); + auto results = cudf::sort(cudf::table_view({zero_size_strings_column})); cudf::test::expect_column_empty(results->view().column(0)); } @@ -117,8 +117,8 @@ INSTANTIATE_TEST_CASE_P(StringsColumnTest, TEST_F(StringsColumnTest, SliceZeroSizeStringsColumn) { - cudf::column_view zero_size_strings_column( - cudf::data_type{cudf::type_id::STRING}, 0, nullptr, nullptr, 0); + auto const zero_size_strings_column = cudf::make_empty_column(cudf::type_id::STRING)->view(); + auto scol = cudf::slice(zero_size_strings_column, {0, 0}); auto results = std::make_unique(scol.front()); cudf::test::expect_column_empty(results->view()); @@ -141,8 +141,8 @@ TEST_F(StringsColumnTest, Gather) TEST_F(StringsColumnTest, GatherZeroSizeStringsColumn) { - cudf::column_view zero_size_strings_column( - cudf::data_type{cudf::type_id::STRING}, 0, nullptr, nullptr, 0); + auto const zero_size_strings_column = cudf::make_empty_column(cudf::type_id::STRING)->view(); + cudf::column_view map_view(cudf::data_type{cudf::type_id::INT32}, 0, nullptr, nullptr, 0); auto results = cudf::gather(cudf::table_view{{zero_size_strings_column}}, map_view)->release(); cudf::test::expect_column_empty(results.front()->view()); @@ -193,9 +193,9 @@ TEST_F(StringsColumnTest, ScatterScalar) TEST_F(StringsColumnTest, ScatterZeroSizeStringsColumn) { - cudf::column_view source(cudf::data_type{cudf::type_id::STRING}, 0, nullptr, nullptr, 0); - cudf::column_view target(cudf::data_type{cudf::type_id::STRING}, 0, nullptr, nullptr, 0); - cudf::column_view scatter_map(cudf::data_type{cudf::type_id::INT8}, 0, nullptr, nullptr, 0); + auto const source = cudf::make_empty_column(cudf::type_id::STRING)->view(); + auto const target = cudf::make_empty_column(cudf::type_id::STRING)->view(); + auto const scatter_map = cudf::make_empty_column(cudf::type_id::INT8)->view(); auto results = cudf::scatter(cudf::table_view({source}), scatter_map, cudf::table_view({target})); cudf::test::expect_column_empty(results->view().column(0)); diff --git a/cpp/tests/strings/attrs_tests.cpp b/cpp/tests/strings/attrs_tests.cpp index 4f2fc485388..c5f38697f00 100644 --- a/cpp/tests/strings/attrs_tests.cpp +++ b/cpp/tests/strings/attrs_tests.cpp @@ -48,8 +48,8 @@ TEST_F(StringsAttributesTest, CodePoints) TEST_F(StringsAttributesTest, ZeroSizeStringsColumn) { - cudf::column_view zero_size_strings_column( - cudf::data_type{cudf::type_id::STRING}, 0, nullptr, nullptr, 0); + auto const zero_size_strings_column = cudf::make_empty_column(cudf::type_id::STRING)->view(); + auto strings_view = cudf::strings_column_view(zero_size_strings_column); cudf::column_view expected_column(cudf::data_type{cudf::type_id::INT32}, 0, nullptr, nullptr, 0); diff --git a/cpp/tests/strings/booleans_tests.cpp b/cpp/tests/strings/booleans_tests.cpp index 21c9f6c70e8..0c7fc992065 100644 --- a/cpp/tests/strings/booleans_tests.cpp +++ b/cpp/tests/strings/booleans_tests.cpp @@ -66,16 +66,15 @@ TEST_F(StringsConvertTest, FromBooleans) TEST_F(StringsConvertTest, ZeroSizeStringsColumnBoolean) { - cudf::column_view zero_size_column(cudf::data_type{cudf::type_id::BOOL8}, 0, nullptr, nullptr, 0); - auto results = cudf::strings::from_booleans(zero_size_column); + auto const zero_size_column = cudf::make_empty_column(cudf::type_id::BOOL8)->view(); + auto results = cudf::strings::from_booleans(zero_size_column); cudf::test::expect_column_empty(results->view()); } TEST_F(StringsConvertTest, ZeroSizeBooleansColumn) { - cudf::column_view zero_size_column( - cudf::data_type{cudf::type_id::STRING}, 0, nullptr, nullptr, 0); - auto results = cudf::strings::to_booleans(zero_size_column); + auto const zero_size_strings_column = cudf::make_empty_column(cudf::type_id::STRING)->view(); + auto results = cudf::strings::to_booleans(zero_size_strings_column); EXPECT_EQ(0, results->size()); } diff --git a/cpp/tests/strings/case_tests.cpp b/cpp/tests/strings/case_tests.cpp index 5e2aa0584be..1d82d785ae8 100644 --- a/cpp/tests/strings/case_tests.cpp +++ b/cpp/tests/strings/case_tests.cpp @@ -262,8 +262,8 @@ TEST_F(StringsCaseTest, LongStrings) TEST_F(StringsCaseTest, EmptyStringsColumn) { - cudf::column_view zero_size_strings_column( - cudf::data_type{cudf::type_id::STRING}, 0, nullptr, nullptr, 0); + auto const zero_size_strings_column = cudf::make_empty_column(cudf::type_id::STRING)->view(); + auto strings_view = cudf::strings_column_view(zero_size_strings_column); auto results = cudf::strings::to_lower(strings_view); diff --git a/cpp/tests/strings/combine/concatenate_tests.cpp b/cpp/tests/strings/combine/concatenate_tests.cpp index 37cb7302a8e..95993e6ecbc 100644 --- a/cpp/tests/strings/combine/concatenate_tests.cpp +++ b/cpp/tests/strings/combine/concatenate_tests.cpp @@ -149,8 +149,7 @@ TEST_F(StringsCombineTest, ConcatenateSkipNulls) TEST_F(StringsCombineTest, ConcatZeroSizeStringsColumns) { - cudf::column_view zero_size_strings_column( - cudf::data_type{cudf::type_id::STRING}, 0, nullptr, nullptr, 0); + auto const zero_size_strings_column = cudf::make_empty_column(cudf::type_id::STRING)->view(); std::vector strings_columns; strings_columns.push_back(zero_size_strings_column); strings_columns.push_back(zero_size_strings_column); @@ -161,8 +160,8 @@ TEST_F(StringsCombineTest, ConcatZeroSizeStringsColumns) TEST_F(StringsCombineTest, SingleColumnErrorCheck) { - cudf::column_view col0(cudf::data_type{cudf::type_id::STRING}, 0, nullptr, nullptr, 0); - EXPECT_THROW(cudf::strings::concatenate(cudf::table_view{{col0}}), cudf::logic_error); + auto const col0 = cudf::make_empty_column(cudf::type_id::STRING); + EXPECT_THROW(cudf::strings::concatenate(cudf::table_view{{col0->view()}}), cudf::logic_error); } struct StringsConcatenateWithColSeparatorTest : public cudf::test::BaseFixture {}; @@ -180,7 +179,7 @@ TEST_F(StringsConcatenateWithColSeparatorTest, ExceptionTests) } { - cudf::column_view col0(cudf::data_type{cudf::type_id::STRING}, 0, nullptr, nullptr, 0); + auto const col0 = cudf::make_empty_column(cudf::type_id::STRING)->view(); cudf::test::fixed_width_column_wrapper col1{{1}}; EXPECT_THROW( @@ -200,8 +199,7 @@ TEST_F(StringsConcatenateWithColSeparatorTest, ExceptionTests) TEST_F(StringsConcatenateWithColSeparatorTest, ZeroSizedColumns) { - cudf::column_view col0(cudf::data_type{cudf::type_id::STRING}, 0, nullptr, nullptr, 0); - + auto const col0 = cudf::make_empty_column(cudf::type_id::STRING)->view(); auto results = cudf::strings::concatenate(cudf::table_view{{col0}}, cudf::strings_column_view(col0)); cudf::test::expect_column_empty(results->view()); diff --git a/cpp/tests/strings/combine/join_strings_tests.cpp b/cpp/tests/strings/combine/join_strings_tests.cpp index d413c50f122..ecc7432201f 100644 --- a/cpp/tests/strings/combine/join_strings_tests.cpp +++ b/cpp/tests/strings/combine/join_strings_tests.cpp @@ -73,8 +73,8 @@ TEST_F(JoinStringsTest, JoinLongStrings) TEST_F(JoinStringsTest, JoinZeroSizeStringsColumn) { - cudf::column_view zero_size_strings_column( - cudf::data_type{cudf::type_id::STRING}, 0, nullptr, nullptr, 0); + auto const zero_size_strings_column = cudf::make_empty_column(cudf::type_id::STRING)->view(); + auto strings_view = cudf::strings_column_view(zero_size_strings_column); auto results = cudf::strings::join_strings(strings_view); cudf::test::expect_column_empty(results->view()); diff --git a/cpp/tests/strings/concatenate_tests.cpp b/cpp/tests/strings/concatenate_tests.cpp index e40a90685c4..5cf4015b9e9 100644 --- a/cpp/tests/strings/concatenate_tests.cpp +++ b/cpp/tests/strings/concatenate_tests.cpp @@ -50,8 +50,8 @@ TEST_F(StringsConcatenateTest, Concatenate) cudf::test::strings_column_wrapper strings2(h_strings.data() + 6, h_strings.data() + 10); cudf::test::strings_column_wrapper strings3(h_strings.data() + 10, h_strings.data() + h_strings.size()); - cudf::column_view zero_size_strings_column( - cudf::data_type{cudf::type_id::STRING}, 0, nullptr, nullptr, 0); + + auto const zero_size_strings_column = cudf::make_empty_column(cudf::type_id::STRING)->view(); std::vector strings_columns; strings_columns.push_back(strings1); @@ -67,8 +67,7 @@ TEST_F(StringsConcatenateTest, Concatenate) TEST_F(StringsConcatenateTest, ZeroSizeStringsColumns) { - cudf::column_view zero_size_strings_column( - cudf::data_type{cudf::type_id::STRING}, 0, nullptr, nullptr, 0); + auto const zero_size_strings_column = cudf::make_empty_column(cudf::type_id::STRING)->view(); std::vector strings_columns; strings_columns.push_back(zero_size_strings_column); strings_columns.push_back(zero_size_strings_column); @@ -79,8 +78,7 @@ TEST_F(StringsConcatenateTest, ZeroSizeStringsColumns) TEST_F(StringsConcatenateTest, ZeroSizeStringsPlusNormal) { - cudf::column_view zero_size_strings_column( - cudf::data_type{cudf::type_id::STRING}, 0, nullptr, nullptr, 0); + auto const zero_size_strings_column = cudf::make_empty_column(cudf::type_id::STRING)->view(); std::vector strings_columns; strings_columns.push_back(zero_size_strings_column); diff --git a/cpp/tests/strings/datetime_tests.cpp b/cpp/tests/strings/datetime_tests.cpp index 8ad1858fa36..bb5c96a09bf 100644 --- a/cpp/tests/strings/datetime_tests.cpp +++ b/cpp/tests/strings/datetime_tests.cpp @@ -605,13 +605,11 @@ TEST_F(StringsDatetimeTest, FromTimestampAllSpecifiers) TEST_F(StringsDatetimeTest, ZeroSizeStringsColumn) { - cudf::column_view zero_size_column( - cudf::data_type{cudf::type_id::TIMESTAMP_SECONDS}, 0, nullptr, nullptr, 0); - auto results = cudf::strings::from_timestamps(zero_size_column); + auto const zero_size_column = cudf::make_empty_column(cudf::type_id::TIMESTAMP_SECONDS)->view(); + auto results = cudf::strings::from_timestamps(zero_size_column); cudf::test::expect_column_empty(results->view()); - cudf::column_view zero_size_strings_column( - cudf::data_type{cudf::type_id::STRING}, 0, nullptr, nullptr, 0); + auto const zero_size_strings_column = cudf::make_empty_column(cudf::type_id::STRING)->view(); results = cudf::strings::to_timestamps(cudf::strings_column_view(zero_size_strings_column), cudf::data_type{cudf::type_id::TIMESTAMP_SECONDS}, "%Y"); diff --git a/cpp/tests/strings/durations_tests.cpp b/cpp/tests/strings/durations_tests.cpp index f9026f5f624..0c7a1ad8042 100644 --- a/cpp/tests/strings/durations_tests.cpp +++ b/cpp/tests/strings/durations_tests.cpp @@ -728,13 +728,11 @@ TEST_F(StringsDurationsTest, ParseEscapeCharacters) TEST_F(StringsDurationsTest, ZeroSizeStringsColumn) { - cudf::column_view zero_size_column( - cudf::data_type{cudf::type_id::DURATION_SECONDS}, 0, nullptr, nullptr, 0); - auto results = cudf::strings::from_durations(zero_size_column); + auto const zero_size_column = cudf::make_empty_column(cudf::type_id::DURATION_SECONDS)->view(); + auto results = cudf::strings::from_durations(zero_size_column); cudf::test::expect_column_empty(results->view()); - cudf::column_view zero_size_strings_column( - cudf::data_type{cudf::type_id::STRING}, 0, nullptr, nullptr, 0); + auto const zero_size_strings_column = cudf::make_empty_column(cudf::type_id::STRING)->view(); results = cudf::strings::to_durations(cudf::strings_column_view(zero_size_strings_column), cudf::data_type{cudf::type_id::DURATION_SECONDS}, "%S"); diff --git a/cpp/tests/strings/fill_tests.cpp b/cpp/tests/strings/fill_tests.cpp index 74254b38d2f..aadd68402c8 100644 --- a/cpp/tests/strings/fill_tests.cpp +++ b/cpp/tests/strings/fill_tests.cpp @@ -69,8 +69,7 @@ TEST_F(StringsFillTest, Fill) TEST_F(StringsFillTest, ZeroSizeStringsColumns) { - cudf::column_view zero_size_strings_column( - cudf::data_type{cudf::type_id::STRING}, 0, nullptr, nullptr, 0); + auto const zero_size_strings_column = cudf::make_empty_column(cudf::type_id::STRING)->view(); auto results = cudf::fill(zero_size_strings_column, 0, 0, cudf::string_scalar("")); cudf::test::expect_column_empty(results->view()); } diff --git a/cpp/tests/strings/find_multiple_tests.cpp b/cpp/tests/strings/find_multiple_tests.cpp index 799bf9a3fcb..986f86d2b49 100644 --- a/cpp/tests/strings/find_multiple_tests.cpp +++ b/cpp/tests/strings/find_multiple_tests.cpp @@ -57,9 +57,8 @@ TEST_F(StringsFindMultipleTest, FindMultiple) TEST_F(StringsFindMultipleTest, ZeroSizeStringsColumn) { - cudf::column_view zero_size_strings_column( - cudf::data_type{cudf::type_id::STRING}, 0, nullptr, nullptr, 0); - auto strings_view = cudf::strings_column_view(zero_size_strings_column); + auto const zero_size_strings_column = cudf::make_empty_column(cudf::type_id::STRING)->view(); + auto strings_view = cudf::strings_column_view(zero_size_strings_column); std::vector h_targets{""}; cudf::test::strings_column_wrapper targets(h_targets.begin(), h_targets.end()); auto targets_view = cudf::strings_column_view(targets); @@ -73,9 +72,8 @@ TEST_F(StringsFindMultipleTest, ErrorTest) cudf::test::strings_column_wrapper strings({"this string intentionally left blank"}, {0}); auto strings_view = cudf::strings_column_view(strings); - cudf::column_view zero_size_strings_column( - cudf::data_type{cudf::type_id::STRING}, 0, nullptr, nullptr, 0); - auto empty_view = cudf::strings_column_view(zero_size_strings_column); + auto const zero_size_strings_column = cudf::make_empty_column(cudf::type_id::STRING)->view(); + auto empty_view = cudf::strings_column_view(zero_size_strings_column); // targets must have at least one string EXPECT_THROW(cudf::strings::find_multiple(strings_view, empty_view), cudf::logic_error); diff --git a/cpp/tests/strings/find_tests.cpp b/cpp/tests/strings/find_tests.cpp index e64a368a952..5c0a5b760f5 100644 --- a/cpp/tests/strings/find_tests.cpp +++ b/cpp/tests/strings/find_tests.cpp @@ -250,10 +250,9 @@ TEST_F(StringsFindTest, EndsWith) TEST_F(StringsFindTest, ZeroSizeStringsColumn) { - cudf::column_view zero_size_strings_column( - cudf::data_type{cudf::type_id::STRING}, 0, nullptr, nullptr, 0); - auto strings_view = cudf::strings_column_view(zero_size_strings_column); - auto results = cudf::strings::find(strings_view, cudf::string_scalar("é")); + auto const zero_size_strings_column = cudf::make_empty_column(cudf::type_id::STRING)->view(); + auto strings_view = cudf::strings_column_view(zero_size_strings_column); + auto results = cudf::strings::find(strings_view, cudf::string_scalar("é")); EXPECT_EQ(results->size(), 0); results = cudf::strings::rfind(strings_view, cudf::string_scalar("é")); EXPECT_EQ(results->size(), 0); diff --git a/cpp/tests/strings/integers_tests.cpp b/cpp/tests/strings/integers_tests.cpp index 7a44ca9efba..59805f9cb6d 100644 --- a/cpp/tests/strings/integers_tests.cpp +++ b/cpp/tests/strings/integers_tests.cpp @@ -261,17 +261,16 @@ TEST_F(StringsConvertTest, FromInteger) TEST_F(StringsConvertTest, ZeroSizeStringsColumn) { - cudf::column_view zero_size_column(cudf::data_type{cudf::type_id::INT32}, 0, nullptr, nullptr, 0); - auto results = cudf::strings::from_integers(zero_size_column); + auto const zero_size_column = cudf::make_empty_column(cudf::type_id::INT32)->view(); + auto results = cudf::strings::from_integers(zero_size_column); cudf::test::expect_column_empty(results->view()); } TEST_F(StringsConvertTest, ZeroSizeIntegersColumn) { - cudf::column_view zero_size_column( - cudf::data_type{cudf::type_id::STRING}, 0, nullptr, nullptr, 0); + auto const zero_size_strings_column = cudf::make_empty_column(cudf::type_id::STRING)->view(); auto results = - cudf::strings::to_integers(zero_size_column, cudf::data_type{cudf::type_id::INT32}); + cudf::strings::to_integers(zero_size_strings_column, cudf::data_type{cudf::type_id::INT32}); EXPECT_EQ(0, results->size()); } diff --git a/cpp/tests/strings/ipv4_tests.cpp b/cpp/tests/strings/ipv4_tests.cpp index 268806dd3cf..2b2d5730ca7 100644 --- a/cpp/tests/strings/ipv4_tests.cpp +++ b/cpp/tests/strings/ipv4_tests.cpp @@ -72,7 +72,8 @@ TEST_F(StringsConvertTest, IntegersToIPv4) TEST_F(StringsConvertTest, ZeroSizeStringsColumnIPV4) { - cudf::column_view zero_size_column(cudf::data_type{cudf::type_id::INT64}, 0, nullptr, nullptr, 0); + auto const zero_size_column = cudf::make_empty_column(cudf::type_id::INT64)->view(); + auto results = cudf::strings::integers_to_ipv4(zero_size_column); cudf::test::expect_column_empty(results->view()); results = cudf::strings::ipv4_to_integers(results->view()); diff --git a/cpp/tests/strings/pad_tests.cpp b/cpp/tests/strings/pad_tests.cpp index 8c07cb62c6b..81ec87a12a8 100644 --- a/cpp/tests/strings/pad_tests.cpp +++ b/cpp/tests/strings/pad_tests.cpp @@ -97,8 +97,8 @@ TEST_F(StringsPadTest, PaddingBoth) TEST_F(StringsPadTest, ZeroSizeStringsColumn) { - cudf::column_view zero_size_strings_column( - cudf::data_type{cudf::type_id::STRING}, 0, nullptr, nullptr, 0); + auto const zero_size_strings_column = cudf::make_empty_column(cudf::type_id::STRING)->view(); + auto strings_view = cudf::strings_column_view(zero_size_strings_column); auto results = cudf::strings::pad(strings_view, 5); cudf::test::expect_column_empty(results->view()); diff --git a/cpp/tests/strings/replace_tests.cpp b/cpp/tests/strings/replace_tests.cpp index 4a45773a29a..f143983aded 100644 --- a/cpp/tests/strings/replace_tests.cpp +++ b/cpp/tests/strings/replace_tests.cpp @@ -470,8 +470,8 @@ TEST_F(StringsReplaceTest, ReplaceMultiLong) TEST_F(StringsReplaceTest, EmptyStringsColumn) { - cudf::column_view zero_size_strings_column( - cudf::data_type{cudf::type_id::STRING}, 0, nullptr, nullptr, 0); + auto const zero_size_strings_column = cudf::make_empty_column(cudf::type_id::STRING)->view(); + auto strings_view = cudf::strings_column_view(zero_size_strings_column); auto results = cudf::strings::replace( strings_view, cudf::string_scalar("not"), cudf::string_scalar("pertinent")); diff --git a/cpp/tests/strings/reverse_tests.cpp b/cpp/tests/strings/reverse_tests.cpp index 8c3f87709ff..3df42b61ebf 100644 --- a/cpp/tests/strings/reverse_tests.cpp +++ b/cpp/tests/strings/reverse_tests.cpp @@ -45,8 +45,8 @@ TEST_F(StringsReverseTest, Reverse) TEST_F(StringsReverseTest, EmptyStringsColumn) { - cudf::column_view zero_size_strings_column( - cudf::data_type{cudf::type_id::STRING}, 0, nullptr, nullptr, 0); + auto const zero_size_strings_column = cudf::make_empty_column(cudf::type_id::STRING)->view(); + auto results = cudf::strings::reverse(cudf::strings_column_view(zero_size_strings_column)); auto view = results->view(); cudf::test::expect_column_empty(results->view()); diff --git a/cpp/tests/strings/slice_tests.cpp b/cpp/tests/strings/slice_tests.cpp index 1162bbb6b13..92230d06672 100644 --- a/cpp/tests/strings/slice_tests.cpp +++ b/cpp/tests/strings/slice_tests.cpp @@ -288,15 +288,15 @@ TEST_F(StringsSliceTest, Error) TEST_F(StringsSliceTest, ZeroSizeStringsColumn) { - cudf::column_view zero_size_strings_column( - cudf::data_type{cudf::type_id::STRING}, 0, nullptr, nullptr, 0); - auto strings_view = cudf::strings_column_view(zero_size_strings_column); + auto const zero_size_strings_column = cudf::make_empty_column(cudf::type_id::STRING)->view(); + auto strings_view = cudf::strings_column_view(zero_size_strings_column); auto results = cudf::strings::slice_strings(strings_view, 1, 2); cudf::test::expect_column_empty(results->view()); - cudf::column_view starts_column(cudf::data_type{cudf::type_id::INT32}, 0, nullptr, nullptr, 0); - cudf::column_view stops_column(cudf::data_type{cudf::type_id::INT32}, 0, nullptr, nullptr, 0); + auto const starts_column = cudf::make_empty_column(cudf::type_id::INT32)->view(); + auto const stops_column = cudf::make_empty_column(cudf::type_id::INT32)->view(); + results = cudf::strings::slice_strings(strings_view, starts_column, stops_column); cudf::test::expect_column_empty(results->view()); } diff --git a/cpp/tests/strings/split_tests.cpp b/cpp/tests/strings/split_tests.cpp index e8c4ec8e19c..445e283ef45 100644 --- a/cpp/tests/strings/split_tests.cpp +++ b/cpp/tests/strings/split_tests.cpp @@ -676,8 +676,8 @@ TEST_F(StringsSplitTest, RSplitRegexWithMaxSplit) TEST_F(StringsSplitTest, SplitZeroSizeStringsColumns) { - cudf::column_view zero_size_strings_column( - cudf::data_type{cudf::type_id::STRING}, 0, nullptr, nullptr, 0); + auto const zero_size_strings_column = cudf::make_empty_column(cudf::type_id::STRING)->view(); + auto prog = cudf::strings::regex_program::create("\\s"); auto results = cudf::strings::split(zero_size_strings_column); EXPECT_TRUE(results->num_columns() == 1); @@ -912,8 +912,8 @@ TEST_F(StringsSplitTest, RPartitionWhitespace) TEST_F(StringsSplitTest, PartitionZeroSizeStringsColumns) { - cudf::column_view zero_size_strings_column( - cudf::data_type{cudf::type_id::STRING}, 0, nullptr, nullptr, 0); + auto const zero_size_strings_column = cudf::make_empty_column(cudf::type_id::STRING)->view(); + auto results = cudf::strings::partition(zero_size_strings_column); EXPECT_TRUE(results->num_columns() == 0); results = cudf::strings::rpartition(zero_size_strings_column); diff --git a/cpp/tests/strings/strip_tests.cpp b/cpp/tests/strings/strip_tests.cpp index bd6d587e0a1..63179474944 100644 --- a/cpp/tests/strings/strip_tests.cpp +++ b/cpp/tests/strings/strip_tests.cpp @@ -92,8 +92,8 @@ TEST_F(StringsStripTest, StripBoth) TEST_F(StringsStripTest, EmptyStringsColumn) { - cudf::column_view zero_size_strings_column( - cudf::data_type{cudf::type_id::STRING}, 0, nullptr, nullptr, 0); + auto const zero_size_strings_column = cudf::make_empty_column(cudf::type_id::STRING)->view(); + auto strings_view = cudf::strings_column_view(zero_size_strings_column); auto results = cudf::strings::strip(strings_view); auto view = results->view(); diff --git a/cpp/tests/strings/translate_tests.cpp b/cpp/tests/strings/translate_tests.cpp index 6b4288196f9..ab3973242c6 100644 --- a/cpp/tests/strings/translate_tests.cpp +++ b/cpp/tests/strings/translate_tests.cpp @@ -62,8 +62,8 @@ TEST_F(StringsTranslateTest, Translate) TEST_F(StringsTranslateTest, ZeroSizeStringsColumn) { - cudf::column_view zero_size_strings_column( - cudf::data_type{cudf::type_id::STRING}, 0, nullptr, nullptr, 0); + auto const zero_size_strings_column = cudf::make_empty_column(cudf::type_id::STRING)->view(); + auto strings_view = cudf::strings_column_view(zero_size_strings_column); std::vector> translate_table; auto results = cudf::strings::translate(strings_view, translate_table); diff --git a/cpp/tests/strings/urls_tests.cpp b/cpp/tests/strings/urls_tests.cpp index 22147d33569..2aec72160cc 100644 --- a/cpp/tests/strings/urls_tests.cpp +++ b/cpp/tests/strings/urls_tests.cpp @@ -226,10 +226,10 @@ TEST_F(StringsConvertTest, UrlDecodeLargeStrings) TEST_F(StringsConvertTest, ZeroSizeUrlStringsColumn) { - cudf::column_view zero_size_column( - cudf::data_type{cudf::type_id::STRING}, 0, nullptr, nullptr, 0); - auto results = cudf::strings::url_encode(zero_size_column); + auto const zero_size_strings_column = cudf::make_empty_column(cudf::type_id::STRING)->view(); + + auto results = cudf::strings::url_encode(zero_size_strings_column); cudf::test::expect_column_empty(results->view()); - results = cudf::strings::url_decode(zero_size_column); + results = cudf::strings::url_decode(zero_size_strings_column); cudf::test::expect_column_empty(results->view()); } diff --git a/cpp/tests/text/ngrams_tests.cpp b/cpp/tests/text/ngrams_tests.cpp index feb0cf538b0..323b3eed3e2 100644 --- a/cpp/tests/text/ngrams_tests.cpp +++ b/cpp/tests/text/ngrams_tests.cpp @@ -101,8 +101,8 @@ TEST_F(TextGenerateNgramsTest, NgramsWithNulls) TEST_F(TextGenerateNgramsTest, Empty) { - cudf::column_view zero_size_strings_column( - cudf::data_type{cudf::type_id::STRING}, 0, nullptr, nullptr, 0); + auto const zero_size_strings_column = cudf::make_empty_column(cudf::type_id::STRING)->view(); + auto results = nvtext::generate_ngrams(cudf::strings_column_view(zero_size_strings_column)); cudf::test::expect_column_empty(results->view()); results = nvtext::generate_character_ngrams(cudf::strings_column_view(zero_size_strings_column));