fix(types): normalize nullable any return bindings - #291
Open
dd-david-levin wants to merge 1 commit into
Open
Conversation
Treat a nullable anyN? occurrence as a nullable use of the required base binding when deriving composite return types. This lets list<any1?> resolve to required any1 while allowing the return occurrence to reapply nullable output. Also make IntervalDayType.WithNullability honor the Type copy contract so return derivation cannot mutate function argument types.
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #291 +/- ##
==========================================
+ Coverage 70.41% 70.45% +0.03%
==========================================
Files 48 48
Lines 11087 11090 +3
==========================================
+ Hits 7807 7813 +6
+ Misses 2910 2908 -2
+ Partials 370 369 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
dd-david-levin
marked this pull request as draft
August 13, 2026 14:16
dd-david-levin
marked this pull request as ready for review
August 13, 2026 14:50
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.
Summary
Normalize a nullable
anyN?occurrence to the required base binding when deriving polymorphic return types, then let the return occurrence reapply its declared nullability.This implements the return-substitution side of the semantics documented in substrait-io/substrait#960. In particular:
Without this change, the map key incorrectly remains nullable and resolves as
map<string?, i64?>.Details
anyN?source occurrences inunwrapAnyTypeWithName.anyNremains required andanyN?is nullable.IntervalDayType.WithNullabilityhonor theTypeinterface's copy contract. This prevents return derivation from mutating an input argument while normalizing its binding.This is complementary to draft #244. That PR addresses broader argument matching and constrained-binding consistency; this PR is narrowly about extracting the correct binding for return-type substitution.
Testing
Both pass.
This PR was developed with AI assistance. All changes have been reviewed, and I take full responsibility for this contribution.