Repository navigation
refactor: separate extension validation - #12271
Open
Phoenix500526 wants to merge 1 commit into
Open
Phoenix500526 wants to merge 1 commit into
Phoenix500526 wants to merge 1 commit into
Conversation
Some extension checks construct descriptors only to discard them. Keep validation independent of construction without changing the ExtensionType contract. Refs apache#9708
Phoenix500526
marked this pull request as ready for review
November 16, 2026 06:50
Contributor
Author
|
@sdf-jkl This PR is ready for review now. And CC @Rich-T-kid in case you're interested |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
ExtensionType::validatewithinExtensionType::try_new#9708Rationale 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?
try_newandvalidateforFixedShapeTensor,VariableShapeTensor,Json, andWkbType.supports_data_type.The helpers allow constructors and validators to share checks while retaining the existing by-value
validatesignature. 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_typeassertions 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::validateimplementation remains available for downstream implementations.AI usage disclosure
Codex helped implement and review the refactor and test assertions, and run local validation.