You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/01/17 16:07:06 UTC

[GitHub] [arrow] pitrou commented on a change in pull request #11918: ARROW-12060: [Python] Enable calling compute functions on Expressions

pitrou commented on a change in pull request #11918:
URL: https://github.com/apache/arrow/pull/11918#discussion_r786139689



##########
File path: python/pyarrow/_compute.pyx
##########
@@ -2019,6 +2019,25 @@ cdef class Expression(_Weakrefable):
             return (<Expression> expr)
         return (<Expression> Expression._scalar(expr))
 
+    @staticmethod
+    def _call_function(str function_name, arguments,
+                       FunctionOptions options=None):
+        cdef:
+            vector[CExpression] c_arguments
+            shared_ptr[CFunctionOptions] c_options=(
+                <shared_ptr[CFunctionOptions]> nullptr)
+
+        for argument in arguments:
+            if not isinstance(argument, Expression):
+                raise TypeError("only other expressions allowed as arguments")
+            c_arguments.push_back((<Expression> argument).expr)
+
+        # if options is not None:
+        #     c_options = make_shared[CFunctionOptions](options.get_options())

Review comment:
       You should probably replace the `unique_ptr` in the FunctionOptions declaration with a `shared_ptr`.




-- 
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-unsubscribe@arrow.apache.org

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