Skip to content

Commit

Permalink
fix replace nulls tests
Browse files Browse the repository at this point in the history
  • Loading branch information
karthikeyann committed Dec 12, 2023
1 parent b841fed commit 6fb609a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions cpp/tests/groupby/replace_nulls_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include <cudf/groupby.hpp>
#include <cudf/replace.hpp>
#include <cudf/sorting.hpp>
#include <cudf/table/table.hpp>
#include <cudf/table/table_view.hpp>
#include <cudf/types.hpp>
Expand All @@ -44,10 +45,15 @@ void TestReplaceNullsGroupbySingle(K const& key,
{
cudf::groupby::groupby gb_obj(cudf::table_view({key}));
std::vector<cudf::replace_policy> policies{policy};
auto p = gb_obj.replace_nulls(cudf::table_view({input}), policies);

CUDF_TEST_EXPECT_TABLES_EQUAL(*p.first, cudf::table_view({expected_key}));
CUDF_TEST_EXPECT_TABLES_EQUAL(*p.second, cudf::table_view({expected_val}));
auto result = gb_obj.replace_nulls(cudf::table_view({input}), policies);

cudf::test::print(result.first->get_column(0));
cudf::test::print(expected_key);
auto const sort_order = cudf::sorted_order(result.first->view());
auto const sorted_keys = cudf::gather(result.first->view(), *sort_order);
auto const sorted_vals = cudf::gather(result.second->view(), *sort_order);
CUDF_TEST_EXPECT_TABLES_EQUAL(*sorted_keys, cudf::table_view({expected_key}));
CUDF_TEST_EXPECT_TABLES_EQUAL(*sorted_vals, cudf::table_view({expected_val}));
}

TYPED_TEST(GroupbyReplaceNullsFixedWidthTest, PrecedingFill)
Expand Down

0 comments on commit 6fb609a

Please sign in to comment.