Phoenix500526 opened a new pull request, #12271:
URL: https://github.com/apache/arrow-rs/pull/12271

   # Which issue does this PR close?
   
   - Relates to #9708
   
   # Rationale for this change
   
   Checking whether a field has a valid fixed-shape tensor, variable-shape 
tensor, or WKB extension currently constructs an extension descriptor and 
discards it. JSON validation also creates a default descriptor solely to check 
the storage type.
   
   # What changes are included in this PR?
   
   - Share private validation helpers between `try_new` and `validate` for 
`FixedShapeTensor`, `VariableShapeTensor`, `Json`, and `WkbType`.
   - Extract the tensor metadata checks into private methods that borrow 
metadata. The constructors retain ownership of the original metadata without 
cloning it for validation.
   - Reuse the JSON and WKB helpers from `supports_data_type`.
   
   The helpers allow constructors and validators to share checks while 
retaining the existing by-value `validate` signature. Removing the trait's 
default implementation is left for a separate API change.
   
   # Are these changes tested?
   
   Existing tests cover construction, invalid metadata and storage types, and 
metadata round-trips. Added `has_valid_extension_type` assertions to the 
existing successful field tests, including all three JSON storage types and 
both metadata representations. No new test functions were added.
   
   # Are there any significant user-facing changes?
   
   No public API signatures or accepted-input rules change. The default 
`ExtensionType::validate` implementation remains available for downstream 
implementations.
   
   # AI usage disclosure
   
   Codex helped implement and review the refactor and test assertions, and run 
local validation.
   


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