[
https://issues.apache.org/jira/browse/ARROW-2856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16545383#comment-16545383
]
Antoine Pitrou commented on ARROW-2856:
---------------------------------------
This is consistent with Numpy behaviour. I would expect PyArrow to not be
stricter than Numpy here:
{code:python}
>>> np.int8([1.1])
array([1], dtype=int8)
{code}
> [Python/C++] Array constructor should not truncate floats when casting to int
> -----------------------------------------------------------------------------
>
> Key: ARROW-2856
> URL: https://issues.apache.org/jira/browse/ARROW-2856
> Project: Apache Arrow
> Issue Type: Bug
> Components: Python
> Affects Versions: 0.9.0
> Reporter: Florian Jetter
> Priority: Minor
> Fix For: 0.10.0
>
>
> I would expect the following code to raise instead of truncating the float
> {code}
> In [4]: pa.array([1.9], type=pa.int8())
> Out[4]:
> <pyarrow.lib.Int8Array object at 0x113455e58>
> [
> 1
> ]
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)