Rich-T-kid opened a new pull request, #12337:
URL: https://github.com/apache/arrow-rs/pull/12337

   # Which issue does this PR close?
   
   - Part of #12325.
   
   # Rationale for this change
   
   Canonical tensor storage uses `FixedSizeList`, whose list size is an `i32`. 
Fixed-shape products and variable-shape dimension counts outside that range are 
currently accepted and can later panic while building or validating the storage 
type. A negative variable-shape storage size also panics during extension 
import instead of returning an error.
   
   # What changes are included in this PR?
   
   Validate fixed-shape products and variable-shape dimension counts before 
constructing the extension. Invalid storage dimensions now return `ArrowError`, 
and zero-product fixed shapes avoid overflowing an intermediate product.
   
   This overlaps the tensor validation paths changed by #12271. If that lands 
first, these bounds should move into its shared validation helpers during 
rebase.
   
   # Are these changes tested?
   
   The tests cover the `i32::MAX` boundary, overflowing shape products, 
zero-product shapes, oversized JSON metadata through 
`Field::try_extension_type`, oversized variable dimensions, and negative 
variable-shape storage dimensions.
   
   # Are there any significant user-facing changes?
   
   Yes. Invalid tensor shapes now return an error instead of panicking later.
   


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