From 6fb609a9677eb73a91dc3f390ec35074921158e4 Mon Sep 17 00:00:00 2001 From: Karthikeyan Natarajan Date: Thu, 30 Mar 2023 11:30:45 +0530 Subject: [PATCH] fix replace nulls tests --- cpp/tests/groupby/replace_nulls_tests.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/cpp/tests/groupby/replace_nulls_tests.cpp b/cpp/tests/groupby/replace_nulls_tests.cpp index d4bd278aaad..41a789fcf79 100644 --- a/cpp/tests/groupby/replace_nulls_tests.cpp +++ b/cpp/tests/groupby/replace_nulls_tests.cpp @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -44,10 +45,15 @@ void TestReplaceNullsGroupbySingle(K const& key, { cudf::groupby::groupby gb_obj(cudf::table_view({key})); std::vector 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)