yongster opened a new pull request, #11247: URL: https://github.com/apache/arrow-rs/pull/11247
# Which issue does this PR close? - Closes #11246. # Rationale for this change `FixedShapeTensor::try_new` stores the physical shape, but the type only exposes `dimensions()` and `list_size()`. Those are the same for `[2, 6]` and `[3, 4]`, so a caller cannot recover the shape without parsing the extension metadata JSON. PyArrow's `FixedShapeTensorType.shape` and Arrow C++'s `FixedShapeTensorType::shape()` already return this value. # What changes are included in this PR? - `FixedShapeTensor::shape(&self) -> &[usize]` - `FixedShapeTensorMetadata::shape(&self) -> &[usize]` - A doc example for `[2, 6]`, and a test that `[2, 6]` and `[3, 4]` stay distinct while sharing `dimensions()` and `list_size()` Serialization and validation are unchanged. This does not rename the metadata key `permutations`. # Are these changes tested? Yes. - `cargo test -p arrow-schema --features canonical_extension_types --lib extension::canonical::fixed_shape_tensor` - `cargo test -p arrow-schema --doc --features canonical_extension_types shape` - `cargo clippy -p arrow-schema --features canonical_extension_types --all-targets --no-deps -- -D warnings` # Are there any user-facing changes? Additive API only, behind the existing `canonical_extension_types` feature. No breaking change. AI assistance: the accessors and tests were drafted with AI and then checked against the existing `dimension_names()` / `permutations()` style. -- 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]
