Skip to content

Auto-convert Integer to Long in set filters (3.0)#1308

Draft
jasmith-hs wants to merge 1 commit intomasterfrom
integer-set-to-long-conversion
Draft

Auto-convert Integer to Long in set filters (3.0)#1308
jasmith-hs wants to merge 1 commit intomasterfrom
integer-set-to-long-conversion

Conversation

@jasmith-hs
Copy link
Copy Markdown
Contributor

Description

Adds a INTEGER_SET_TO_LONG_CONVERSION feature flag to AbstractSetFilter that, 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_CONVERSION is explicitly activated in FeatureConfig. 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 on
  • itDoesNotConvertWhenFeatureInactive — verifies empty intersection (no conversion) and no spurious warning when feature is off
  • itDoesNotWarnOnIntegerLongMismatchWithoutFeature — verifies the mismatch warning is suppressed for Integer/Long pairs

Verification

Run AbstractSetFilterTest locally.

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

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant