lidavidm commented on a change in pull request #11026:
URL: https://github.com/apache/arrow/pull/11026#discussion_r699313007



##########
File path: cpp/src/arrow/compute/kernels/scalar_temporal.cc
##########
@@ -337,6 +339,41 @@ struct ISOWeek {
   Localizer localizer_;
 };
 
+template <typename Duration, typename Localizer>
+struct Week {
+  explicit Week(const DayOfWeekOptions* options, Localizer&& localizer)
+      : localizer_(std::move(localizer)), 
count_offset_(options->one_based_numbering) {
+    if (options->week_start == 7) {
+      start_week_ = sun;
+      mid_week_ = wed;
+
+    } else {
+      start_week_ = mon;
+      mid_week_ = thu;
+    }

Review comment:
       Do we intend to only support these two cases? If so we should validate 
it somewhere and make sure it's described in the docstring.

##########
File path: cpp/src/arrow/compute/kernels/scalar_temporal.cc
##########
@@ -337,6 +339,41 @@ struct ISOWeek {
   Localizer localizer_;
 };

Review comment:
       Given ISOWeek is a special case of Week now, maybe we should just have 
one kernel (and perhaps some conveniences, e.g. DayOfWeekOptions::IsoWeek())?




-- 
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]


Reply via email to