apache / apache/arrow

[Python] cast does not allow structs to be renamed

Open
#44,296 0 comments 0 reactions 0 assignees View on GitHub
Component: Python Type: bug
Dominant language
C++
Stars
17.1k
Forks
4.3k
Avg merge
3d 13h
Merged PRs (30d)
88

Description

### Describe the bug, including details regarding any error messages, version, and platform.

I have an arrow table with a single struct column in it. When I call cast() or otherwise try to rename the fields within the struct I encounter the following error:

```
struct fields don't match or are in the wrong order: Input fields: struct<: int64, : string> output fields: struct
```

It should be possible to cast a struct to another struct where the only difference is the names in the column. Furthermore, based on the use case of cast, it should be possible to also change the type of the struct fields (such as int64 to duration as in the example for cast).

### Component(s)

Python

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.