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

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

pcmoritz commented on a change in pull request #1216: ARROW-972: UnionArray in 
pyarrow
URL: https://github.com/apache/arrow/pull/1216#discussion_r149788510
 
 

 ##########
 File path: python/pyarrow/scalar.pxi
 ##########
 @@ -315,6 +315,26 @@ cdef class ListValue(ArrayValue):
         return result
 
 
+cdef class UnionValue(ArrayValue):
+
+    cdef void _set_array(self, const shared_ptr[CArray]& sp_array):
+        self.sp_array = sp_array
+        self.ap = <CUnionArray*> sp_array.get()
+        self.value_types = [pyarrow_wrap_data_type(self.ap.value_type(i))
+                            for i in range(self.ap.num_fields())]
 
 Review comment:
   Oops, good point! I'm constructing the Python objects for children types 
once per array in the UnionType.

----------------------------------------------------------------
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:
us...@infra.apache.org


> [Python] Add test cases and basic APIs for UnionArray
> -----------------------------------------------------
>
>                 Key: ARROW-972
>                 URL: https://issues.apache.org/jira/browse/ARROW-972
>             Project: Apache Arrow
>          Issue Type: New Feature
>          Components: Python
>    Affects Versions: 0.3.0
>            Reporter: Wes McKinney
>            Assignee: Philipp Moritz
>              Labels: pull-request-available
>             Fix For: 0.8.0
>
>
> While this is implemented in C++, there isn't any API exposure yet in Python



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

Reply via email to