milesgranger commented on code in PR #14395:
URL: https://github.com/apache/arrow/pull/14395#discussion_r1012883181


##########
python/pyarrow/_compute.pyx:
##########
@@ -1168,6 +1168,46 @@ class SliceOptions(_SliceOptions):
         self._set_options(start, stop, step)
 
 
+cdef class _ListSliceOptions(FunctionOptions):
+    cpdef _set_options(self, start, stop=None, step=1, 
return_fixed_size_list=True):
+        # NB: Assigning optional[int64_t] on stack seems available once 
Cython>=3 available.
+        # due to cpp_locals directive:
+        # 
https://cython.readthedocs.io/en/latest/src/userguide/wrapping_CPlusPlus.html#cpp-locals-directive

Review Comment:
   I was having a heck of a time getting a local variable initialized in the 
function, always complaining:
   ```
   CListSliceOptions* opts
               optional[int64_t] c_stop
                                         ^
    c++ class must have a nullary constructor to be stack allocated
   ```
   Even taking the same arguments passed to the current `new 
CListSliceOptions(...)` and attempting to assign them to `optional[int64_t]` 
cdef variable right away would result in that error. 
   
   Is there a way you would expect to be able to at least initialize `nullopt` 
and then I can update it with `stop` if not None?



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to