Skip to content

Commit

Permalink
Deprecate single component extraction methods in libcudf (#17221)
Browse files Browse the repository at this point in the history
This PR deprecates the single component extraction methods (eg. `cudf::datetime::extract_year`) that are already covered by `cudf::datetime::extract_datetime_component`.
xref #17143

Authors:
  - Matthew Murray (https://github.com/Matt711)

Approvers:
  - David Wendt (https://github.com/davidwendt)
  - Karthikeyan (https://github.com/karthikeyann)

URL: #17221
  • Loading branch information
Matt711 authored Nov 5, 2024
1 parent 9d5041c commit ac5b3ed
Show file tree
Hide file tree
Showing 3 changed files with 135 additions and 144 deletions.
40 changes: 30 additions & 10 deletions cpp/include/cudf/datetime.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,16 @@ enum class datetime_component : uint8_t {
* @brief Extracts year from any datetime type and returns an int16_t
* cudf::column.
*
* @deprecated Deprecated in 24.12, to be removed in 25.02
*
* @param column cudf::column_view of the input datetime values
* @param stream CUDA stream used for device memory operations and kernel launches
* @param mr Device memory resource used to allocate device memory of the returned column
*
* @returns cudf::column of the extracted int16_t years
* @throw cudf::logic_error if input column datatype is not TIMESTAMP
*/
std::unique_ptr<cudf::column> extract_year(
[[deprecated]] std::unique_ptr<cudf::column> extract_year(
cudf::column_view const& column,
rmm::cuda_stream_view stream = cudf::get_default_stream(),
rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref());
Expand All @@ -74,14 +76,16 @@ std::unique_ptr<cudf::column> extract_year(
* @brief Extracts month from any datetime type and returns an int16_t
* cudf::column.
*
* @deprecated Deprecated in 24.12, to be removed in 25.02
*
* @param column cudf::column_view of the input datetime values
* @param stream CUDA stream used for device memory operations and kernel launches
* @param mr Device memory resource used to allocate device memory of the returned column
*
* @returns cudf::column of the extracted int16_t months
* @throw cudf::logic_error if input column datatype is not TIMESTAMP
*/
std::unique_ptr<cudf::column> extract_month(
[[deprecated]] std::unique_ptr<cudf::column> extract_month(
cudf::column_view const& column,
rmm::cuda_stream_view stream = cudf::get_default_stream(),
rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref());
Expand All @@ -90,14 +94,16 @@ std::unique_ptr<cudf::column> extract_month(
* @brief Extracts day from any datetime type and returns an int16_t
* cudf::column.
*
* @deprecated Deprecated in 24.12, to be removed in 25.02
*
* @param column cudf::column_view of the input datetime values
* @param stream CUDA stream used for device memory operations and kernel launches
* @param mr Device memory resource used to allocate device memory of the returned column
*
* @returns cudf::column of the extracted int16_t days
* @throw cudf::logic_error if input column datatype is not TIMESTAMP
*/
std::unique_ptr<cudf::column> extract_day(
[[deprecated]] std::unique_ptr<cudf::column> extract_day(
cudf::column_view const& column,
rmm::cuda_stream_view stream = cudf::get_default_stream(),
rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref());
Expand All @@ -106,14 +112,16 @@ std::unique_ptr<cudf::column> extract_day(
* @brief Extracts a weekday from any datetime type and returns an int16_t
* cudf::column.
*
* @deprecated Deprecated in 24.12, to be removed in 25.02
*
* @param column cudf::column_view of the input datetime values
* @param stream CUDA stream used for device memory operations and kernel launches
* @param mr Device memory resource used to allocate device memory of the returned column
*
* @returns cudf::column of the extracted int16_t days
* @throw cudf::logic_error if input column datatype is not TIMESTAMP
*/
std::unique_ptr<cudf::column> extract_weekday(
[[deprecated]] std::unique_ptr<cudf::column> extract_weekday(
cudf::column_view const& column,
rmm::cuda_stream_view stream = cudf::get_default_stream(),
rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref());
Expand All @@ -122,14 +130,16 @@ std::unique_ptr<cudf::column> extract_weekday(
* @brief Extracts hour from any datetime type and returns an int16_t
* cudf::column.
*
* @deprecated Deprecated in 24.12, to be removed in 25.02
*
* @param column cudf::column_view of the input datetime values
* @param stream CUDA stream used for device memory operations and kernel launches
* @param mr Device memory resource used to allocate device memory of the returned column
*
* @returns cudf::column of the extracted int16_t hours
* @throw cudf::logic_error if input column datatype is not TIMESTAMP
*/
std::unique_ptr<cudf::column> extract_hour(
[[deprecated]] std::unique_ptr<cudf::column> extract_hour(
cudf::column_view const& column,
rmm::cuda_stream_view stream = cudf::get_default_stream(),
rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref());
Expand All @@ -138,14 +148,16 @@ std::unique_ptr<cudf::column> extract_hour(
* @brief Extracts minute from any datetime type and returns an int16_t
* cudf::column.
*
* @deprecated Deprecated in 24.12, to be removed in 25.02
*
* @param column cudf::column_view of the input datetime values
* @param stream CUDA stream used for device memory operations and kernel launches
* @param mr Device memory resource used to allocate device memory of the returned column
*
* @returns cudf::column of the extracted int16_t minutes
* @throw cudf::logic_error if input column datatype is not TIMESTAMP
*/
std::unique_ptr<cudf::column> extract_minute(
[[deprecated]] std::unique_ptr<cudf::column> extract_minute(
cudf::column_view const& column,
rmm::cuda_stream_view stream = cudf::get_default_stream(),
rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref());
Expand All @@ -154,14 +166,16 @@ std::unique_ptr<cudf::column> extract_minute(
* @brief Extracts second from any datetime type and returns an int16_t
* cudf::column.
*
* @deprecated Deprecated in 24.12, to be removed in 25.02
*
* @param column cudf::column_view of the input datetime values
* @param stream CUDA stream used for device memory operations and kernel launches
* @param mr Device memory resource used to allocate device memory of the returned column
*
* @returns cudf::column of the extracted int16_t seconds
* @throw cudf::logic_error if input column datatype is not TIMESTAMP
*/
std::unique_ptr<cudf::column> extract_second(
[[deprecated]] std::unique_ptr<cudf::column> extract_second(
cudf::column_view const& column,
rmm::cuda_stream_view stream = cudf::get_default_stream(),
rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref());
Expand All @@ -173,14 +187,16 @@ std::unique_ptr<cudf::column> extract_second(
* A millisecond fraction is only the 3 digits that make up the millisecond portion of a duration.
* For example, the millisecond fraction of 1.234567890 seconds is 234.
*
* @deprecated Deprecated in 24.12, to be removed in 25.02
*
* @param column cudf::column_view of the input datetime values
* @param stream CUDA stream used for device memory operations and kernel launches
* @param mr Device memory resource used to allocate device memory of the returned column
*
* @returns cudf::column of the extracted int16_t milliseconds
* @throw cudf::logic_error if input column datatype is not TIMESTAMP
*/
std::unique_ptr<cudf::column> extract_millisecond_fraction(
[[deprecated]] std::unique_ptr<cudf::column> extract_millisecond_fraction(
cudf::column_view const& column,
rmm::cuda_stream_view stream = cudf::get_default_stream(),
rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref());
Expand All @@ -192,14 +208,16 @@ std::unique_ptr<cudf::column> extract_millisecond_fraction(
* A microsecond fraction is only the 3 digits that make up the microsecond portion of a duration.
* For example, the microsecond fraction of 1.234567890 seconds is 567.
*
* @deprecated Deprecated in 24.12, to be removed in 25.02
*
* @param column cudf::column_view of the input datetime values
* @param stream CUDA stream used for device memory operations and kernel launches
* @param mr Device memory resource used to allocate device memory of the returned column
*
* @returns cudf::column of the extracted int16_t microseconds
* @throw cudf::logic_error if input column datatype is not TIMESTAMP
*/
std::unique_ptr<cudf::column> extract_microsecond_fraction(
[[deprecated]] std::unique_ptr<cudf::column> extract_microsecond_fraction(
cudf::column_view const& column,
rmm::cuda_stream_view stream = cudf::get_default_stream(),
rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref());
Expand All @@ -211,14 +229,16 @@ std::unique_ptr<cudf::column> extract_microsecond_fraction(
* A nanosecond fraction is only the 3 digits that make up the nanosecond portion of a duration.
* For example, the nanosecond fraction of 1.234567890 seconds is 890.
*
* @deprecated Deprecated in 24.12, to be removed in 25.02
*
* @param column cudf::column_view of the input datetime values
* @param stream CUDA stream used for device memory operations and kernel launches
* @param mr Device memory resource used to allocate device memory of the returned column
*
* @returns cudf::column of the extracted int16_t nanoseconds
* @throw cudf::logic_error if input column datatype is not TIMESTAMP
*/
std::unique_ptr<cudf::column> extract_nanosecond_fraction(
[[deprecated]] std::unique_ptr<cudf::column> extract_nanosecond_fraction(
cudf::column_view const& column,
rmm::cuda_stream_view stream = cudf::get_default_stream(),
rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref());
Expand Down
Loading

0 comments on commit ac5b3ed

Please sign in to comment.