sdf-jkl commented on code in PR #12271:
URL: https://github.com/apache/arrow-rs/pull/12271#discussion_r4721764521


##########
arrow-schema/src/extension/canonical/fixed_shape_tensor.rs:
##########
@@ -90,6 +90,31 @@ impl FixedShapeTensor {
         })
     }
 
+    // Unlike `supports_data_type`, this needs no tensor instance. Borrowing 
metadata
+    // and returning the element type lets `try_new` reuse validation without 
cloning
+    // metadata, while `validate` can check it without constructing a tensor.
+    fn validate_impl<'a>(
+        data_type: &'a DataType,
+        metadata: &FixedShapeTensorMetadata,
+    ) -> Result<&'a DataType, ArrowError> {
+        match data_type {
+            DataType::FixedSizeList(field, list_size) if !field.is_nullable() 
=> {
+                metadata.validate()?;

Review Comment:
   Could we also add some tests that would pin the metadata check down for both 
tensor types?



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