[
https://issues.apache.org/jira/browse/ARROW-16475?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17533997#comment-17533997
]
David Li commented on ARROW-16475:
----------------------------------
Ah, I was thinking the 'smarts' for the usual function wrappers were in
{{call_function}}, but it turns out they're in the actual generated wrappers
instead
(https://github.com/apache/arrow/blob/d00caa947ea53774e0e6745c857bf622457081ad/python/pyarrow/compute.py#L226-L254)
I would argue {{pc.call_function}} would be the right place to put it
> [Python] Publically expose Expression._call
> -------------------------------------------
>
> Key: ARROW-16475
> URL: https://issues.apache.org/jira/browse/ARROW-16475
> Project: Apache Arrow
> Issue Type: Improvement
> Components: Python
> Reporter: Weston Pace
> Priority: Major
>
> When writing a projection expression I can write something clean when using
> the builtin functions:
> {noformat}
> dataset.to_table(columns={'projected': pc.ascii_upper(ds.field('name'))})
> {noformat}
> However, if I am using a custom function (UDF) then there isn't a great
> solution today that I can find. The best I can come up with is:
> {noformat}
> dataset.to_table(columns={'projected': pc.Expression._call('my_udf',
> [ds.field('name')])})
> {noformat}
> I'd think one approach could be:
> {noformat}
> dataset.to_table(columns={'projected': pc.call('my_udf', [ds.field('name')])})
> {noformat}
> However, I'm open to other suggestions as well.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)