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

Jabari Booker commented on ARROW-15455:
---------------------------------------

It seem that you can't cast any lists with {{Scalar}}

 
{code:java}
#For Lists
>>> arrow_list = pa.scalar([1, 2])
>>> arrow_list.cast(pa.list_(pa.int64()))
pyarrow.lib.ArrowNotImplementedError: casting scalars of type list<item: int64> 
to type list<item: int64>

#For LargeLists
>>> arrow_list = pa.scalar([1, 2], pa.large_list(pa.int64()))
>>> arrow_list.cast(pa.large_list(pa.int64()))
pyarrow.lib.ArrowNotImplementedError: casting scalars of type large_list<item: 
int64> to type large_list<item: int64>{code}
 

 

> [C++] Cast between fixed size list type and variable size list 
> ---------------------------------------------------------------
>
>                 Key: ARROW-15455
>                 URL: https://issues.apache.org/jira/browse/ARROW-15455
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: C++
>            Reporter: Joris Van den Bossche
>            Assignee: Jabari Booker
>            Priority: Major
>              Labels: good-second-issue, kernel, pull-request-available
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Casting from fixed size list to variable size list could be possible, I 
> think, but currently doesn't work:
> {code:python}
> >>> fixed_size = pa.array([[1, 2], [3, 4]], type=pa.list_(pa.int64(), 2))
> >>> fixed_size.cast(pa.list_(pa.int64()))
> ...
> ArrowNotImplementedError: Unsupported cast from fixed_size_list<item: 
> int64>[2] to list using function cast_list
> {code}
> And in principle, a cast the other way around could also be possible if it is 
> checked that each list has the correct length.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to