You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/01/25 13:48:00 UTC

[jira] [Commented] (ARROW-2033) pa.array() doesn't work with iterators

    [ https://issues.apache.org/jira/browse/ARROW-2033?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16339231#comment-16339231 ] 

ASF GitHub Bot commented on ARROW-2033:
---------------------------------------

pitrou opened a new pull request #1513: ARROW-2033: [Python] Fix pa.array() with iterator input
URL: https://github.com/apache/arrow/pull/1513
 
 
   Iterator (not iterable) input was broken with pa.array() unless both type and size were explicitly passed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> pa.array() doesn't work with iterators
> --------------------------------------
>
>                 Key: ARROW-2033
>                 URL: https://issues.apache.org/jira/browse/ARROW-2033
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Python
>    Affects Versions: 0.9.0
>            Reporter: Antoine Pitrou
>            Priority: Minor
>              Labels: pull-request-available
>
> pa.array handles iterables fine, but not iterators if size isn't passed:
> {code:java}
> >>> 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
> ]
> {code}
> This is because InferArrowSize() first exhausts the iterator.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)