edponce commented on a change in pull request #11147:
URL: https://github.com/apache/arrow/pull/11147#discussion_r712475283



##########
File path: python/pyarrow/_compute.pyx
##########
@@ -690,99 +677,96 @@ class CastOptions(_CastOptions):
 
 
 cdef class _ElementWiseAggregateOptions(FunctionOptions):
-    def _set_options(self, bint skip_nulls):
+    def _set_options(self, skip_nulls):
         self.wrapped.reset(new CElementWiseAggregateOptions(skip_nulls))
 
 
 class ElementWiseAggregateOptions(_ElementWiseAggregateOptions):
-    def __init__(self, bint skip_nulls=True):
+    def __init__(self, *, skip_nulls=True):
         self._set_options(skip_nulls)
 
 
 cdef CRoundMode unwrap_round_mode(round_mode) except *:
-    if round_mode == 'down':
+    # TODO: Cython 0.29.x does not supports C++ scoped enums as dictionary
+    # values because they do not resolve to integers, so we use if-elses.
+    # Cython 3 fully supports C++ scoped enums resolving to integers, refer to
+    # 
https://cython.readthedocs.io/en/latest/src/userguide/wrapping_CPlusPlus.html#scoped-enumerations
+    if round_mode == "down":

Review comment:
       `RoundMode` and `SortOrder` are scoped enums but they are not fully 
supported (in terms of concise usage) until Cython 3. Arrow currently builds 
for Cython >= 0.29.x, so I left *TODO* comments 
([here](https://github.com/apache/arrow/pull/11147/files#diff-439f91c435cc8136d40eaba8c168aaa1cec00f08b10ba92ce376e47f29f81814R690)
 and 
[here](https://github.com/apache/arrow/pull/11147/files#diff-439f91c435cc8136d40eaba8c168aaa1cec00f08b10ba92ce376e47f29f81814R1114))
 to describe the intent here for working with scoped enums. Also, left *TODO* 
comments 
([here](https://github.com/apache/arrow/pull/11147/files#diff-48e87fef366d65330100bf1703a542b8cb447575b6f8c3a3617741ce57854d4aR2090)
 and 
[here](https://github.com/apache/arrow/pull/11147/files#diff-48e87fef366d65330100bf1703a542b8cb447575b6f8c3a3617741ce57854d4aR1829))
 for defining scoped enums in `includes/libarrow.pxd`.
   
   This is the first time I embed *TODO* comments in Arrow but think they are 
worthwhile. I can also keep track of these notes locally or should this go into 
a future JIRA issue? @pitrou please advise.




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