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

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

xhochy commented on a change in pull request #1588: ARROW-2129: [Python] Handle 
conversion of empty tables to Pandas
URL: https://github.com/apache/arrow/pull/1588#discussion_r167451896
 
 

 ##########
 File path: python/pyarrow/tests/test_convert_pandas.py
 ##########
 @@ -1322,6 +1322,12 @@ def test_table_batch_empty_dataframe(self):
         _check_pandas_roundtrip(df2, preserve_index=True)
         _check_pandas_roundtrip(df2, as_batch=True, preserve_index=True)
 
+    def test_convert_empty_table(self):
+        arr = pa.array([], type=pa.int64())
+        npt.assert_array_equal(arr.to_pandas(), np.array([]))
+        arr = pa.array([], type=pa.string())
+        npt.assert_array_equal(arr.to_pandas(), np.array([]))
 
 Review comment:
   I skipped adding the `dtype` here as `assert_array_equal` seems to ignore it 
anyways. I can add it if it's better for clarification.

----------------------------------------------------------------
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] Segmentation fault on conversion of empty array to Pandas
> ------------------------------------------------------------------
>
>                 Key: ARROW-2129
>                 URL: https://issues.apache.org/jira/browse/ARROW-2129
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Python
>    Affects Versions: 0.8.0
>            Reporter: Uwe L. Korn
>            Assignee: Uwe L. Korn
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 0.9.0
>
>
> Converting an empty {{pyarrow.Array}} to a Pandas series causes a 
> segmentation fault.



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

Reply via email to