[
https://issues.apache.org/jira/browse/ARROW-2033?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16343246#comment-16343246
]
ASF GitHub Bot commented on ARROW-2033:
---------------------------------------
pitrou commented on issue #1513: ARROW-2033: [Python] Fix pa.array() with
iterator input
URL: https://github.com/apache/arrow/pull/1513#issuecomment-361217636
There are (probably unrelated) build errors against the thrift header files:
```
In file included from src/parquet/column_reader.cc:34:0:
src/parquet/thrift.h: In function ‘void parquet::DeserializeThriftMsg(const
uint8_t*, uint32_t*, T*)’:
src/parquet/thrift.h:103:48: error: no matching function for call to
‘apache::thrift::protocol::TCompactProtocolFactoryT<apache::thrift::transport::TMemoryBuffer>::getProtocol(std::shared_ptr<apache::thrift::transport::TMemoryBuffer>&)’
tproto_factory.getProtocol(tmem_transport);
^
src/parquet/thrift.h:103:48: note: candidate is:
In file included from src/parquet/thrift.h:28:0,
from src/parquet/column_reader.cc:34:
/usr/include/thrift/protocol/TCompactProtocol.h:242:32: note:
boost::shared_ptr<apache::thrift::protocol::TProtocol>
apache::thrift::protocol::TCompactProtocolFactoryT<Transport_>::getProtocol(boost::shared_ptr<apache::thrift::transport::TTransport>)
[with Transport_ = apache::thrift::transport::TMemoryBuffer]
boost::shared_ptr<TProtocol> getProtocol(boost::shared_ptr<TTransport>
trans) {
^
```
How should I go about those?
----------------------------------------------------------------
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:
[email protected]
> 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.8.0
> Reporter: Antoine Pitrou
> Assignee: Antoine Pitrou
> Priority: Minor
> Labels: pull-request-available
> Fix For: 0.9.0
>
>
> 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)