From 19814459fb31ecf628d40b3b542c1c4c718842c8 Mon Sep 17 00:00:00 2001 From: David Wendt <45795991+davidwendt@users.noreply.github.com> Date: Thu, 7 Nov 2024 09:57:32 -0500 Subject: [PATCH] Fix extract-datetime deprecation warning in ndsh benchmark (#17254) Fixes deprecation warning introduced by #17221 ``` [165+3+59=226] Building CXX object benchmarks/CMakeFiles/NDSH_Q09_NVBENCH.dir/ndsh/q09.cpp.o /cudf/cpp/benchmarks/ndsh/q09.cpp: In function 'void run_ndsh_q9(nvbench::state&, std::unordered_map, cuio_source_sink_pair>&)': /cudf/cpp/benchmarks/ndsh/q09.cpp:148:33: warning: 'std::unique_ptr cudf::datetime::extract_year(const cudf::column_view&, rmm::cuda_stream_view, rmm::device_async_resource_ref)' is deprecated [-Wdeprecated-declarations] 148 | auto o_year = cudf::datetime::extract_year(joined_table->column("o_orderdate")); | ^~~~~~~~~~~~ In file included from /cudf/cpp/benchmarks/ndsh/q09.cpp:21: /cudf/cpp/include/cudf/datetime.hpp:70:46: note: declared here 70 | [[deprecated]] std::unique_ptr extract_year( | ^~~~~~~~~~~~ /cudf/cpp/benchmarks/ndsh/q09.cpp:148:45: warning: 'std::unique_ptr cudf::datetime::extract_year(const cudf::column_view&, rmm::cuda_stream_view, rmm::device_async_resource_ref)' is deprecated [-Wdeprecated-declarations] 148 | auto o_year = cudf::datetime::extract_year(joined_table->column("o_orderdate")); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /cudf/cpp/benchmarks/ndsh/q09.cpp:21: /cudf/cpp/include/cudf/datetime.hpp:70:46: note: declared here 70 | [[deprecated]] std::unique_ptr extract_year( | ^~~~~~~~~~~~ ``` Authors: - David Wendt (https://github.com/davidwendt) Approvers: - Karthikeyan (https://github.com/karthikeyann) - Shruti Shivakumar (https://github.com/shrshi) URL: https://github.com/rapidsai/cudf/pull/17254 --- cpp/benchmarks/ndsh/q09.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cpp/benchmarks/ndsh/q09.cpp b/cpp/benchmarks/ndsh/q09.cpp index 2e9a69d9ee2..98c951101ed 100644 --- a/cpp/benchmarks/ndsh/q09.cpp +++ b/cpp/benchmarks/ndsh/q09.cpp @@ -145,7 +145,8 @@ void run_ndsh_q9(nvbench::state& state, // Calculate the `nation`, `o_year`, and `amount` columns auto n_name = std::make_unique(joined_table->column("n_name")); - auto o_year = cudf::datetime::extract_year(joined_table->column("o_orderdate")); + auto o_year = cudf::datetime::extract_datetime_component( + joined_table->column("o_orderdate"), cudf::datetime::datetime_component::YEAR); auto amount = calculate_amount(joined_table->column("l_discount"), joined_table->column("l_extendedprice"), joined_table->column("ps_supplycost"),