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

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

wesm closed pull request #1255: ARROW-1739: [Python] Fix broken build due to 
using unittest.TestCase methods
URL: https://github.com/apache/arrow/pull/1255
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/python/pyarrow/array.pxi b/python/pyarrow/array.pxi
index c57eda1da..7da5c3caf 100644
--- a/python/pyarrow/array.pxi
+++ b/python/pyarrow/array.pxi
@@ -373,7 +373,8 @@ cdef class Array:
 
         return pyarrow_wrap_array(result)
 
-    def to_pandas(self, c_bool strings_to_categorical=False, 
zero_copy_only=False):
+    def to_pandas(self, c_bool strings_to_categorical=False,
+                  zero_copy_only=False):
         """
         Convert to an array object suitable for use in pandas
 
diff --git a/python/pyarrow/tests/test_convert_pandas.py 
b/python/pyarrow/tests/test_convert_pandas.py
index ddb7eb41c..8360dae54 100644
--- a/python/pyarrow/tests/test_convert_pandas.py
+++ b/python/pyarrow/tests/test_convert_pandas.py
@@ -218,31 +218,31 @@ def test_zero_copy_success(self):
         npt.assert_array_equal(result, [0, 1, 2])
 
     def test_zero_copy_failure_on_object_types(self):
-        with self.assertRaises(pa.ArrowException):
+        with pytest.raises(pa.ArrowException):
             pa.array(['A', 'B', 'C']).to_pandas(zero_copy_only=True)
 
     def test_zero_copy_failure_with_int_when_nulls(self):
-        with self.assertRaises(pa.ArrowException):
+        with pytest.raises(pa.ArrowException):
             pa.array([0, 1, None]).to_pandas(zero_copy_only=True)
 
     def test_zero_copy_failure_with_float_when_nulls(self):
-        with self.assertRaises(pa.ArrowException):
+        with pytest.raises(pa.ArrowException):
             pa.array([0.0, 1.0, None]).to_pandas(zero_copy_only=True)
 
     def test_zero_copy_failure_on_bool_types(self):
-        with self.assertRaises(pa.ArrowException):
+        with pytest.raises(pa.ArrowException):
             pa.array([True, False]).to_pandas(zero_copy_only=True)
 
     def test_zero_copy_failure_on_list_types(self):
         arr = np.array([[1, 2], [8, 9]], dtype=object)
 
-        with self.assertRaises(pa.ArrowException):
+        with pytest.raises(pa.ArrowException):
             pa.array(arr).to_pandas(zero_copy_only=True)
 
     def test_zero_copy_failure_on_timestamp_types(self):
         arr = np.array(['2007-07-13'], dtype='datetime64[ns]')
 
-        with self.assertRaises(pa.ArrowException):
+        with pytest.raises(pa.ArrowException):
             pa.array(arr).to_pandas(zero_copy_only=True)
 
     def test_zero_copy_dictionaries(self):
@@ -250,7 +250,7 @@ def test_zero_copy_dictionaries(self):
             np.array([0, 0]),
             np.array(['A']))
 
-        with self.assertRaises(pa.ArrowException):
+        with pytest.raises(pa.ArrowException):
             arr.to_pandas(zero_copy_only=True)
 
     def test_float_nulls(self):


 

----------------------------------------------------------------
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] Fix usages of assertRaises causing broken build
> --------------------------------------------------------
>
>                 Key: ARROW-1739
>                 URL: https://issues.apache.org/jira/browse/ARROW-1739
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Python
>            Reporter: Wes McKinney
>            Assignee: Wes McKinney
>              Labels: pull-request-available
>             Fix For: 0.8.0
>
>
> There were conflicting changes from PRs merged -- one of the test classes was 
> made not a subclass of unittest.TestCase



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

Reply via email to