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

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

cpcloud commented on a change in pull request #1682: ARROW-2232: [Python] 
pyarrow.Tensor constructor segfaults
URL: https://github.com/apache/arrow/pull/1682#discussion_r171628034
 
 

 ##########
 File path: python/pyarrow/array.pxi
 ##########
 @@ -497,10 +497,15 @@ cdef class Tensor:
         self.type = pyarrow_wrap_data_type(self.tp.type())
 
     def __repr__(self):
+        if self.tp is NULL:
 
 Review comment:
   > If the constructor took the C++ shared_ptr as argument and checked its 
validity, you wouldn't need to sprinkle checks in the other methods/properties.
   
   With pybind the situation is even better, because it would allow us to have 
constructors for numpy arrays and python lists with the same API e.g., 
`pa.Tensor([1])`/`pa.Tensor(np.array([1]))` without having to deal with 
initialization by hand at all.

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


> [Python] pyarrow.Tensor constructor segfaults
> ---------------------------------------------
>
>                 Key: ARROW-2232
>                 URL: https://issues.apache.org/jira/browse/ARROW-2232
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Python
>    Affects Versions: 0.8.0
>            Reporter: Phillip Cloud
>            Assignee: Phillip Cloud
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 0.9.0
>
>
> {{pa.Tensor()}}, {{pa.Tensor([])}}, and {{pa.Tensor([1.0])}} all crash the 
> interpreter.



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

Reply via email to