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

   ### Describe the enhancement requested
   
   Earlier today, I ran into this confusing error message:
   `
   ArrowTypeError:  Casting from 'extension<arrow.fixed_shape_tensor>' to 
different extension type 'extension<arrow.fixed_shape_tensor>' not permitted. 
One can first cast to the storage type, then to the extension type.
   `
   
   Those look like the same extension type to me, what is going on?
   
   In truth, they had different shapes. One was shaped `(6, 6)` while the other 
was shaped `(36,)`.
   
   It would have been clearer if I had an error message like this:
   
   `
   ArrowTypeError:  Casting from 
'extension<arrow.fixed_shape_tensor<shape=[6,6],type=float64>' to different 
extension type 'extension<arrow.fixed_shape_tensor<shape=[36],type=float64>' 
not permitted. One can first cast to the storage type, then to the extension 
type.
   `
   
   That bit I'm suggesting should change appears to be coming from `__str__`: 
https://github.com/apache/arrow/blob/505a2e4519ba8d4983da6caa1c56ecae8d063e84/python/pyarrow/types.pxi#LL220C39-L220C39.
 It would be nice if 
[FixedShapeTensorType](https://github.com/apache/arrow/blob/505a2e4519ba8d4983da6caa1c56ecae8d063e84/python/pyarrow/types.pxi#L1511)
 had a custom `__str__` implementation which revealed its parameters.
   
   ### 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