alamb commented on issue #3999:
URL: https://github.com/apache/arrow-rs/issues/3999#issuecomment-1493424522

   > What are your thoughts on these error messages?
   
   > 
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=e5e12eacb2b9041f988afe2012637a74
   
   
   ```
   = note: expected reference `&PrimitiveArray<DurationType>`
                 found reference `&PrimitiveArray<TimestampNanosecondType>`
   note: associated function defined here
     --> src/main.rs:5:8
      |
   5  |     fn add(&self, rhs: &Rhs) -> Result<Self::Output, String>;
   ```
   ✅  This one seems good
   
   
   > 
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=6550efd10b3bf3ec7e7806de71fc6d0e
   
   ```
   = help: the following other types implement trait `Add<Rhs>`:
                <PrimitiveArray<TimestampNanosecondType> as 
Add<PrimitiveArray<DurationType>>>
                <PrimitiveArray<TimestampNanosecondType> as 
Add<PrimitiveArray<IntervalType>>>
   ```
   
   This one is also ok given there are only two options and they are probably 
what the user wants. However, I think in reality there would be so many impls 
that the ones I cared about (for adding timestamps)  would not make it into the 
actual message (they would be hidden behind `...`) and that is 👎 as  then I 
would have to go spelunking into the arrow type system to figure out what was 
going on.
   
   Maybe this could be handled with sufficiently good and detailed examples and 
messages. 


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