jorisvandenbossche commented on a change in pull request #11918:
URL: https://github.com/apache/arrow/pull/11918#discussion_r786232820
##########
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:
Yes, that's what I did in the meantime. The only difficulty I ran into
is that moving a uniqe_ptr to shared_ptr doesn't seem to work in cython, but
with our helper `to_shared` it worked.
--
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]