[
https://issues.apache.org/jira/browse/ARROW-17333?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17576984#comment-17576984
]
Will Jones commented on ARROW-17333:
------------------------------------
I am not able to reproduce that error on 9.0.0 or dev, at least in Conda on
MacOS. In both cases I get the same expected result you show for 8.0.0.
Could you double check your pyarrow version and then provide more details on
your environment (OS, how you installed pyarrow)?
> [C++] Unsupported cast using function cast_struct
> -------------------------------------------------
>
> Key: ARROW-17333
> URL: https://issues.apache.org/jira/browse/ARROW-17333
> Project: Apache Arrow
> Issue Type: Bug
> Components: C++
> Affects Versions: 9.0.0
> Reporter: Hyun S
> Priority: Major
> Labels: kernel
>
> Casting of structs that were introduced in ARROW-1888 no longer seems to work
> on the new 9.0.0 release. However, works on the older 8.0.0 release.
> I've included the same example given in ARROW-1888 to reproduce the error.
>
> Steps to reproduce:
> {{arr = pa.array([\\{'a': 1, 'b': None}, \\{'a': 2, 'b': None}])}}
> {{print(arr.type)}}
> {{arr.cast(pa.struct([('a', pa.int64()), ('b', pa.int64())]))}}
>
> Expected:
> {{<pyarrow.lib.StructArray object at 0x7fb475f0e460> – is_valid: all not null
> – child 0 type: int64 [ 1, 2 ] – child 1 type: int64 [ null, null ] }}
>
> Actual Results:
> {{ArrowNotImplementedError: Unsupported cast from struct<a: int64, b: null>
> to struct using function cast_struct}}
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)