Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-15477

[C++][Python] Enable ListArray::FromArrays with custom list type (field names/nullability)

    XMLWordPrintableJSON

Details

    Description

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

      >>> 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>)
      

      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.

      Attachments

        Issue Links

          Activity

            People

              jorisvandenbossche Joris Van den Bossche
              jorisvandenbossche Joris Van den Bossche
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 10m
                  1h 10m