Skip to content

[Python] Table.from_struct_array function #33500

Closed

Description

@asfimport

Following up on this stack overflow question: https://stackoverflow.com/questions/74430949/table-from-nested-list-struct

Would it be worth introducing a Table.from_struct_array function?

I'm actually not 100% sure it is needed or if it make sense.

For example, I'm not sure how it should behave when receiving a ChunkedArray (of type StructType) vs receiving a StructArray. In which case it's behaviour feels a bit overloaded and maybe it belongs to the compute package.

Also it's already possible to do such a thing (as illustrated in the SO question). Maybe it's more a problem of documentation. An example like this could be added to the cookbook.

 

Reporter: &res / @0x26res

Note: This issue was originally created as ARROW-18330. Please see the migration documentation for further details.

Activity

  1. jorisvandenbossche commented on Jan 18, 2023

    @jorisvandenbossche
    Member

    Given that this already exists on RecordBatch, I think it makes sense to add it to Table as well.

    I'm not sure how it should behave when receiving a ChunkedArray (of type StructType) vs receiving a StructArray.

    In both cases it would return a Table. I would say it is actually natural to convert a Chunked StructArray to a Table, since each column in the table is chunked anyway.

  2. added a commit that references this issue on Jan 8, 2024
  3. added this to the 15.0.0 milestone on Jan 8, 2024
  4. jorisvandenbossche commented on Jan 8, 2024

    @jorisvandenbossche
    Member

    Fixed by @judahrand

  5. added a commit that references this issue on Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions