milesgranger opened a new pull request, #14836:
URL: https://github.com/apache/arrow/pull/14836

   Will close [ARROW-18281](https://issues.apache.org/jira/browse/ARROW-18281)
   
   Depends on 
   - #14749 
   
   Follows the Python slicing semantics, in that if `start<0 or step<0 or 
start>=stop` then
   empty lists are returned, and a error is raised if `step==0`.
   
   ```python
   In [1]: arr = pa.array([[1, 2, 3], [4, 5], None], pa.list_(pa.int8()))
   
   In [2]: pc.list_slice(arr, start=0, stop=2, step=-1)
   Out[2]:
   <pyarrow.lib.ListArray object at 0x7fd379f73d00>
   [
     [],
     [],
     null
   ]
   
   In [3]: pc.list_slice(arr, start=-1, stop=2, step=1)
   Out[3]:
   <pyarrow.lib.ListArray object at 0x7fd379f73be0>
   [
     [],
     [],
     null
   ]
   ```


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