Auto-convert Integer to Long in set filters (3.0)#1308
Draft
jasmith-hs wants to merge 1 commit intomasterfrom
Draft
Auto-convert Integer to Long in set filters (3.0)#1308jasmith-hs wants to merge 1 commit intomasterfrom
jasmith-hs wants to merge 1 commit intomasterfrom
Conversation
Integer/Long mismatches are common when set elements come from different sources (e.g. one side from a Java Long field, the other from a Jinja literal that resolves to Integer). These are semantically equivalent but cause empty intersections without any actionable warning. The new INTEGER_SET_TO_LONG_CONVERSION feature widens the Integer set to Long before performing the operation so the result is correct. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Description
Adds a
INTEGER_SET_TO_LONG_CONVERSIONfeature flag toAbstractSetFilterthat, when active, automatically widens Integer elements to Long before performing set operations (intersect, union, difference, symmetric difference).BRAVE
Backwards Compatibility
Fully backwards-compatible — the conversion only happens when
INTEGER_SET_TO_LONG_CONVERSIONis explicitly activated inFeatureConfig. Existing behavior is unchanged when the feature is off. Integer/Long mismatches are silently tolerated (no warning emitted) in both cases, since they are "potentially convertible."Rollout and Rollback Plan
Enable via
FeatureConfig.newBuilder().add(BuiltInFeatures.INTEGER_SET_TO_LONG_CONVERSION, FeatureStrategies.ACTIVE). Rollback by removing the feature from config.Automated Testing
Tests added:
itConvertsIntegerToLongWhenFeatureActive— verifies correct intersection result when feature is onitDoesNotConvertWhenFeatureInactive— verifies empty intersection (no conversion) and no spurious warning when feature is offitDoesNotWarnOnIntegerLongMismatchWithoutFeature— verifies the mismatch warning is suppressed for Integer/Long pairsVerification
Run
AbstractSetFilterTestlocally.Expect Dependencies to Fail
No.
REVIEWERS: Please review both the code changes and the answers above, and validate that they match the expectations for BRAVE