[ 
https://issues.apache.org/jira/browse/ARROW-16475?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17534003#comment-17534003
 ] 

Weston Pace commented on ARROW-16475:
-------------------------------------

{{pc.call_function}} works for me.  I'll update the title.

> [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)

Reply via email to