maartenbreddels commented on a change in pull request #8271:
URL: https://github.com/apache/arrow/pull/8271#discussion_r500873548



##########
File path: python/pyarrow/_compute.pyx
##########
@@ -560,6 +560,29 @@ cdef class MatchSubstringOptions(FunctionOptions):
         return self.match_substring_options.get()
 
 
+cdef class SplitOptions(FunctionOptions):
+    cdef:
+        unique_ptr[CSplitOptions] split_options
+
+    def __init__(self, max_splits, reverse):
+        self.split_options.reset(
+            new CSplitOptions(max_splits, reverse))
+
+    cdef const CFunctionOptions* get_options(self) except NULL:
+        return self.split_options.get()
+
+
+cdef class SplitPatternOptions(FunctionOptions):
+    cdef:
+        unique_ptr[CSplitPatternOptions] split_pattern_options
+
+    def __init__(self, pattern, max_splits, reverse):

Review comment:
       Yes, that would be nicer, but *args is not passed in the auto compute 
wrapper. Also, 
https://github.com/apache/arrow/blob/master/python/pyarrow/tests/test_compute.py#L68
 would fail.
   
   However, given @jorisvandenbossche comment about having pattern an 
array/scalar (i.e. making the kernel binary) would remove the issue.
   
   I make it `*, pattern` now, with the downside of having to write ` 
pc.utf8_split_whitespace(arr, options={})` instead of no arguments.




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

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


Reply via email to