Skip to content

Commit

Permalink
fix type-match error check logic
Browse files Browse the repository at this point in the history
  • Loading branch information
davidwendt committed Dec 14, 2021
1 parent 7d89adb commit 40d15df
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cpp/include/cudf/dictionary/dictionary_column_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion cpp/src/copying/copy.cu
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ std::unique_ptr<column> 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);
Expand Down
1 change: 1 addition & 0 deletions cpp/tests/copying/copy_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit 40d15df

Please sign in to comment.