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

[Python] ListArray.flatten() should take care of slicing offsets

    XMLWordPrintableJSON

Details

    Description

      Currently ListArray.flatten() simply returns the child array. If a ListArray is a slice of another ListArray, they will share the same child array, however the expected behavior (I think) of flatten() should be returning an Array that's a concatenation of all the sub-lists in the ListArray, so the slicing offset should be taken into account.

       

      For example:

      a = pa.array([[1], [2], [3]])

      assert a.flatten().equals(pa.array([1,2,3]))

      1. expected:

      a.slice(1).flatten().equals(pa.array([2, 3]))

      Attachments

        Issue Links

          Activity

            People

              brillsp Zhuo Peng
              brillsp Zhuo Peng
              Votes:
              0 Vote for this issue
              Watchers:
              5 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 - 2h 40m
                  2h 40m