snigdhachoppac commented on code in PR #50675:
URL: https://github.com/apache/arrow/pull/50675#discussion_r3668234310
##########
cpp/src/arrow/compute/kernels/scalar_temporal_unary.cc:
##########
@@ -177,6 +178,32 @@ struct TemporalComponentExtractRound
static Status Exec(KernelContext* ctx, const ExecSpan& batch, ExecResult*
out) {
const RoundTemporalOptions& options = RoundTemporalState::Get(ctx);
+
+ if constexpr (std::is_same_v<InType, DurationType>) {
+ if (options.calendar_based_origin) {
+ return Status::Invalid(
+ "calendar_based_origin is not supported for duration inputs");
+ }
+
+ if (options.unit == CalendarUnit::WEEK) {
+ RoundTemporalOptions duration_options = options;
+ duration_options.unit = CalendarUnit::DAY;
+ duration_options.multiple *= 7;
Review Comment:
Added a checked multiplication using MultiplyWithOverflow before converting
week multiples to days, along with regression coverage for ceil_temporal,
floor_temporal, and round_temporal. The targeted tests, full 56-test temporal
C++ suite, and pandas integration tests pass locally.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]