From 40d15df367e5a61c91bad789c6b85a8a2000a078 Mon Sep 17 00:00:00 2001 From: David Wendt Date: Tue, 14 Dec 2021 11:49:50 -0500 Subject: [PATCH] fix type-match error check logic --- cpp/include/cudf/dictionary/dictionary_column_view.hpp | 2 +- cpp/src/copying/copy.cu | 2 +- cpp/tests/copying/copy_tests.cpp | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cpp/include/cudf/dictionary/dictionary_column_view.hpp b/cpp/include/cudf/dictionary/dictionary_column_view.hpp index 039673fd868..42f8310040e 100644 --- a/cpp/include/cudf/dictionary/dictionary_column_view.hpp +++ b/cpp/include/cudf/dictionary/dictionary_column_view.hpp @@ -78,7 +78,7 @@ class dictionary_column_view : private column_view { column_view keys() const noexcept; /** - * @brief Returns data_type of the keys + * @brief Returns the `data_type` of the keys child column. */ data_type keys_type() const noexcept; diff --git a/cpp/src/copying/copy.cu b/cpp/src/copying/copy.cu index dbd1ad5d389..91fc5f02989 100644 --- a/cpp/src/copying/copy.cu +++ b/cpp/src/copying/copy.cu @@ -369,7 +369,7 @@ std::unique_ptr copy_if_else(scalar const& lhs, "Boolean mask column must be the same size as rhs column"); auto rhs_type = - cudf::is_dictionary(rhs.type()) ? cudf::dictionary_column_view(rhs).keys_type() : lhs.type(); + cudf::is_dictionary(rhs.type()) ? cudf::dictionary_column_view(rhs).keys_type() : rhs.type(); CUDF_EXPECTS(lhs.type() == rhs_type, "Both inputs must be of the same type"); return copy_if_else(lhs, rhs, !lhs.is_valid(stream), rhs.has_nulls(), boolean_mask, stream, mr); diff --git a/cpp/tests/copying/copy_tests.cpp b/cpp/tests/copying/copy_tests.cpp index 82a64d74b1f..4468bc69640 100644 --- a/cpp/tests/copying/copy_tests.cpp +++ b/cpp/tests/copying/copy_tests.cpp @@ -715,4 +715,5 @@ TEST_F(DictionaryCopyIfElseTest, TypeMismatch) cudf::string_scalar input3{"1"}; EXPECT_THROW(cudf::copy_if_else(input1, input3, mask), cudf::logic_error); EXPECT_THROW(cudf::copy_if_else(input3, input2, mask), cudf::logic_error); + EXPECT_THROW(cudf::copy_if_else(input2, input3, mask), cudf::logic_error); }