amol- commented on PR #13099: URL: https://github.com/apache/arrow/pull/13099#issuecomment-1123364801
> But we can probably improve that, instead of adding the `apply` method? Allowing "non expressions" would be risky by the way, as the current check to decide to return back an expression or not is based on `isinstance(args[0], Expression)`. If we allowed plain python types in compute functions when they should return an `Expression` we would introduce ambiguity when `pc.multiply(10, pc.field("a"))` is used. As the first argument is no longer an `Expression`. To do so we would probably have to change the check to see if _any_ argument is an expression. I guess we can totally live with using `pc.multiply(pc.scalar(10), pc.field("a"))` as we do know and avoid changing the code. -- 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