You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Joris Van den Bossche (Jira)" <ji...@apache.org> on 2022/01/27 14:52:00 UTC

[jira] [Created] (ARROW-15477) [C++][Python] Enable ListArray::FromArrays with custom list type (field names/nullability)

Joris Van den Bossche created ARROW-15477:
---------------------------------------------

             Summary: [C++][Python] Enable ListArray::FromArrays with custom list type (field names/nullability)
                 Key: ARROW-15477
                 URL: https://issues.apache.org/jira/browse/ARROW-15477
             Project: Apache Arrow
          Issue Type: Improvement
          Components: C++, Python
            Reporter: Joris Van den Bossche


Currently, when creating a ListArray from the values and offets, you get a "default" list type:

{code:python}
>>> arr = pa.ListArray.from_arrays(pa.array([0, 2, 5], pa.int32()), pa.array([1, 2, 3, 4, 5]))
>>> arr
<pyarrow.lib.ListArray object at 0x7f75bdf03dc0>
[
  [
    1,
    2
  ],
  [
    3,
    4,
    5
  ]
]

>>> arr.type
ListType(list<item: int64>)
{code}

So a type with default field name ("item") and nullability (true). 
We should allow to specify a type (that needs to be compatible with the passed values' type) so you can create a ListArray with specific field names.



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