alanhdu opened a new issue, #39917:
URL: https://github.com/apache/arrow/issues/39917

   ### Describe the enhancement requested
   
   Right now, if you have a pyarrow array thaty ou try to `take` the empty list 
on, you get:
   
   ```python
   >>> import pyarrow as pa
   >>> pa.array([1, 2, 3]).take([])
   
   File 
~/micromamba/envs/ctrldev/lib/python3.10/site-packages/pyarrow/array.pxi:1348, 
in pyarrow.lib.Array.take()
   
   File 
~/micromamba/envs/ctrldev/lib/python3.10/site-packages/pyarrow/compute.py:473, 
in take(data, indices, boundscheck, memory_pool)
       433 """
       434 Select values (or records) from array- or table-like data given 
integer
       435 selection indices.
      (...)
       470 ]
       471 """
       472 options = TakeOptions(boundscheck=boundscheck)
   --> 473 return call_function('take', [data, indices], options, memory_pool)
   
   File 
~/micromamba/envs/ctrldev/lib/python3.10/site-packages/pyarrow/_compute.pyx:560,
 in pyarrow._compute.call_function()
   
   File 
~/micromamba/envs/ctrldev/lib/python3.10/site-packages/pyarrow/_compute.pyx:355,
 in pyarrow._compute.Function.call()
   
   File 
~/micromamba/envs/ctrldev/lib/python3.10/site-packages/pyarrow/error.pxi:144, 
in pyarrow.lib.pyarrow_internal_check_status()
   
   File 
~/micromamba/envs/ctrldev/lib/python3.10/site-packages/pyarrow/error.pxi:121, 
in pyarrow.lib.check_status()
   
   ArrowNotImplementedError: Function 'array_take' has no kernel matching input 
types (int64, null)
   ```
   
   Would it be possible to support `take` with an empty list (and have it 
return an empty array)? Otherwise, this forces us to special-case empty-lists 
in our calling code, even when there's an "obvious" semantics here.
   
   ### Component(s)
   
   Python


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