sdf-jkl commented on code in PR #12271:
URL: https://github.com/apache/arrow-rs/pull/12271#discussion_r4725391397
##########
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:
I think one case per test could've been enough. We're only pinning the
metadata check itself.
The ext type specific checks are already tested in their impls:
-
https://github.com/apache/arrow-rs/blob/b325878f30/arrow-schema/src/extension/canonical/fixed_shape_tensor.rs#L605-L617
-
https://github.com/apache/arrow-rs/blob/b325878f30/arrow-schema/src/extension/canonical/variable_shape_tensor.rs#L621-L634
--
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]