jorisvandenbossche commented on code in PR #41904:
URL: https://github.com/apache/arrow/pull/41904#discussion_r1701397524


##########
python/pyarrow/tests/strategies.py:
##########
@@ -35,7 +38,10 @@
         import tzdata  # noqa:F401
     except ImportError:
         zoneinfo = None
-import numpy as np
+try:
+    import numpy as np
+except ImportError:
+    np = None

Review Comment:
   The "strategies" defined in this file are not marked as needing numpy. Are 
the tests using those strategies marked as such? 
   
   (not that we are testing this, because we run the hypothesis tests only in 
one build which has numpy, so it's also fine to assume that numpy is available 
for the hypothesis tests I think)



##########
python/pyarrow/tests/conftest.py:
##########
@@ -25,8 +25,14 @@
 
 import pytest
 import hypothesis as h
+try:
+    import numpy as np

Review Comment:
   Is this import still needed? (I think with the latest updates `np` is not 
used anymore in this file?)



##########
python/pyarrow/tests/test_convert_builtin.py:
##########
@@ -285,15 +288,16 @@ def test_list_with_non_list(seq):
 @pytest.mark.parametrize("factory", [
     pa.list_, pa.large_list, pa.list_view, pa.large_list_view])
 def test_nested_arrays(seq, factory):
-    arr = pa.array(seq([np.array([], dtype=np.int64),
-                        np.array([1, 2], dtype=np.int64), None]),
+    arr = pa.array(seq([pa.array([], type=pa.int64()),
+                        pa.array([1, 2], type=pa.int64()), None]),

Review Comment:
   In hindsight, this should maybe be kept as numpy arrays .. (and just mark as 
requiring numpy)  
   At least it is useful to also test nested data construction where the inner 
values are numpy arrays (probably ideally we would test both, like parametrize 
on the sequence type for the inner sequences as well?)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to