bkietz commented on code in PR #40687:
URL: https://github.com/apache/arrow/pull/40687#discussion_r1540137376
##########
cpp/src/arrow/compute/function.cc:
##########
@@ -426,6 +426,7 @@ Status ScalarFunction::AddKernel(ScalarKernel kernel) {
if (arity_.is_varargs && !kernel.signature->is_varargs()) {
return Status::Invalid("Function accepts varargs but kernel signature does
not");
}
+ kernel.is_pure = is_pure();
Review Comment:
> Would weak_ptr be more explicit?
I don't think weak_ptr adds anything; the lifetime of a Function is managed
by the registry anyway, IE they are basically never destroyed. If ownership
becomes a concern later it's easy enough to add `enable_shared_from_this` to
`compute::Function` or replace with a weak_ptr
> Seems reasonable, so should we promote this refactoring in other PRs?
It does seem reasonable to open a separate PR to add `Kernel::function`
--
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]