HaoYang670 opened a new issue, #2715:
URL: https://github.com/apache/arrow-rs/issues/2715

   **Is your feature request related to a problem or challenge? Please describe 
what you are trying to do.**
   The function `try_binary` currently panic on `a.len() != b.len()`:
   ```rust
   pub fn try_binary<A, B, F, O>(
       a: &PrimitiveArray<A>,
       b: &PrimitiveArray<B>,
       op: F,
   ) -> Result<PrimitiveArray<O>>
   where
       A: ArrowPrimitiveType,
       B: ArrowPrimitiveType,
       O: ArrowPrimitiveType,
       F: Fn(A::Native, B::Native) -> Result<O::Native>,
   {
       assert_eq!(a.len(), b.len());
       ...
   ```
   
   It is better to let the function return an error in such case because:
   1. The return type of the function is a Result;
   2. `a.length() != b.length()` is a recoverable error
   
   **Describe the solution you'd like**
   1. Replace panic with Err
   2. Update the docs
   
   **Describe alternatives you've considered**
   We could not do this
   
   **Additional context**
   <!--
   Add any other context or screenshots about the feature request here.
   -->
   


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