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/04/18 09:42:00 UTC

[jira] [Commented] (ARROW-2147) [Python] Type inference doesn't work on lists of Numpy arrays

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

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

xhochy commented on a change in pull request #1908: ARROW-2147: [Python] Fix type inference of numpy arrays
URL: https://github.com/apache/arrow/pull/1908#discussion_r182368285
 
 

 ##########
 File path: python/pyarrow/tests/test_parquet.py
 ##########
 @@ -813,6 +813,9 @@ def _check_roundtrip(table, expected=None, **params):
     result = _roundtrip_table(table, **params)
     assert result.equals(expected)
 
+    result = _roundtrip_table(result, **params)
 
 Review comment:
   No issue with 0.9 but the second rountrip failed on 0.8

----------------------------------------------------------------
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


> [Python] Type inference doesn't work on lists of Numpy arrays
> -------------------------------------------------------------
>
>                 Key: ARROW-2147
>                 URL: https://issues.apache.org/jira/browse/ARROW-2147
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: Python
>    Affects Versions: 0.8.0
>            Reporter: Antoine Pitrou
>            Assignee: Uwe L. Korn
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 0.10.0
>
>
> {code:python}
> >>> arr = np.int16([2, 3, 4])
> >>> pa.array(arr)
> <pyarrow.lib.Int16Array object at 0x7f939f30a0e8>
> [
>   2,
>   3,
>   4
> ]
> >>> pa.array([arr])
> Traceback (most recent call last):
>   File "<ipython-input-6-254285212203>", line 1, in <module>
>     pa.array([arr])
>   File "array.pxi", line 181, in pyarrow.lib.array
>   File "array.pxi", line 26, in pyarrow.lib._sequence_to_array
>   File "error.pxi", line 77, in pyarrow.lib.check_status
> ArrowInvalid: /home/antoine/arrow/cpp/src/arrow/python/builtin_convert.cc:964 code: InferArrowType(seq, &real_type)
> /home/antoine/arrow/cpp/src/arrow/python/builtin_convert.cc:321 code: seq_visitor.Visit(obj)
> /home/antoine/arrow/cpp/src/arrow/python/builtin_convert.cc:195 code: VisitElem(ref, level)
> Error inferring Arrow data type for collection of Python objects. Got Python object of type ndarray but can only handle these types: bool, float, integer, date, datetime, bytes, unicode
> {code}



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