wjones127 commented on code in PR #3276:
URL: https://github.com/apache/arrow-rs/pull/3276#discussion_r1039998760


##########
arrow-pyarrow-integration-testing/tests/test_sql.py:
##########
@@ -193,6 +200,34 @@ def test_time32_python():
     del b
     del expected
 
+
+def test_empty_array_python():
+    """
+    Python -> Rust -> Python
+    """
+    a = pa.array([], pa.int32())

Review Comment:
   Did this one. We now get two failures:
   
   ```
   =========================================================================== 
FAILURES 
============================================================================
   _________________________________________________________________ 
test_empty_array_python[null] 
_________________________________________________________________
   
   datatype = DataType(null)
   
       @pytest.mark.parametrize("datatype", _supported_pyarrow_types, ids=str)
       def test_empty_array_python(datatype):
           """
           Python -> Rust -> Python
           """
           if datatype == pa.float16():
               pytest.skip("Float 16 is not implemented in Rust")
       
           a = pa.array([], datatype)
   >       b = rust.round_trip_array(a)
   E       pyo3_runtime.PanicException: assertion failed: index < 
array.n_buffers as usize
   
   tests/test_sql.py:213: PanicException
   --------------------------------------------------------------------- 
Captured stderr call 
----------------------------------------------------------------------
   thread '<unnamed>' panicked at 'assertion failed: index < array.n_buffers as 
usize', /Users/willjones/Documents/arrow-rs/arrow/src/ffi.rs:586:5
   note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
   __________________________________________ 
test_empty_array_python[dictionary<values=string, indices=int8, ordered=0>] 
__________________________________________
   
   datatype = DictionaryType(dictionary<values=string, indices=int8, ordered=0>)
   
       @pytest.mark.parametrize("datatype", _supported_pyarrow_types, ids=str)
       def test_empty_array_python(datatype):
           """
           Python -> Rust -> Python
           """
           if datatype == pa.float16():
               pytest.skip("Float 16 is not implemented in Rust")
       
           a = pa.array([], datatype)
   >       b = rust.round_trip_array(a)
   E       pyarrow.lib.ArrowException: C Data interface error: The external 
buffer at position 0 is null.
   
   tests/test_sql.py:213: ArrowException
   ```



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