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

pa.array() doesn't work with iterators

    Details

      Description

      pa.array handles iterables fine, but not iterators if size isn't passed:

      >>> arr = pa.array(range(5))
      >>> arr
      <pyarrow.lib.Int64Array object at 0x7f4652a05318>
      [
        0,
        1,
        2,
        3,
        4
      ]
      >>> arr = pa.array(iter(range(5)))
      >>> arr
      <pyarrow.lib.NullArray object at 0x7f4633c1d638>
      [
        NA,
        NA,
        NA,
        NA,
        NA
      ]
      

      This is because InferArrowSize() first exhausts the iterator.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                pitrou Antoine Pitrou
                Reporter:
                pitrou Antoine Pitrou
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: