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

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

Github user wesm commented on the issue:

    https://github.com/apache/arrow/issues/1217
  
    Hi, we do not yet support the syntax you are using for creating an array of 
structs. After adding missing square brackets:
    
    ```
    In [2]: pa.array([{"foo":"bar"}, {"foo":"bar"}, {"foo":"bar"}])
    ---------------------------------------------------------------------------
    ArrowNotImplementedError                  Traceback (most recent call last)
    <ipython-input-2-5383db65d4fd> in <module>()
    ----> 1 pa.array([{"foo":"bar"}, {"foo":"bar"}, {"foo":"bar"}])
    
    /home/wesm/code/arrow/python/pyarrow/array.pxi in pyarrow.lib.array 
(/home/wesm/code/arrow/python/build/temp.linux-x86_64-3.5/lib.cxx:25024)()
    
    /home/wesm/code/arrow/python/pyarrow/array.pxi in 
pyarrow.lib._sequence_to_array 
(/home/wesm/code/arrow/python/build/temp.linux-x86_64-3.5/lib.cxx:23628)()
    
    /home/wesm/code/arrow/python/pyarrow/error.pxi in pyarrow.lib.check_status 
(/home/wesm/code/arrow/python/build/temp.linux-x86_64-3.5/lib.cxx:8242)()
    
    ArrowNotImplementedError: 
/home/wesm/code/arrow/cpp/src/arrow/python/builtin_convert.cc:740 code: 
InferArrowTypeAndSize(obj, &size, &type)
    /home/wesm/code/arrow/cpp/src/arrow/python/builtin_convert.cc:319 code: 
InferArrowType(obj, out_type)
    /home/wesm/code/arrow/cpp/src/arrow/python/builtin_convert.cc:299 code: 
seq_visitor.Visit(obj)
    /home/wesm/code/arrow/cpp/src/arrow/python/builtin_convert.cc:180 code: 
VisitElem(ref, level)
    No type inference for dicts
    ```
    
    I would like to support this, but implementing it is quite some work. 
Patches are welcome. I opened https://issues.apache.org/jira/browse/ARROW-1705 
to track the feature request. 


> [Python] Create StructArray (+ type inference) from sequence of dicts
> ---------------------------------------------------------------------
>
>                 Key: ARROW-1705
>                 URL: https://issues.apache.org/jira/browse/ARROW-1705
>             Project: Apache Arrow
>          Issue Type: New Feature
>          Components: Python
>            Reporter: Wes McKinney
>              Labels: pull-request-available
>
> See https://github.com/apache/arrow/issues/1217



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to