Repository navigation
Conversation
satisfies_order_of read source_type, which is never set on TruncateTransform, so comparing two truncate transforms with different widths raised AttributeError. The source type is not known on the unbound transform, and a wider truncation only preserves the order of a narrower one for strings, so only equal transforms are reported as satisfying the order. Closes apache#3680 Generated-by: Grok Bot (AI coding assistant)
rambleraptor
suggested changes
Nov 3, 2026
rambleraptor
left a comment
Collaborator
There was a problem hiding this comment.
The Java implementation specifically checks widths. I'm not sure if this is the approach we want to take.
A truncate transform satisfies the order of another truncate transform when its width is greater than or equal to the other's, as in the Java Truncate implementation. This no longer reads the missing source_type attribute. Generated-by: Grok Bot (AI coding assistant)
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.
Closes #3680
Rationale for this change
TruncateTransform.satisfies_order_ofreadsself.source_type, but_source_typeis never set onTruncateTransform, so comparing two truncate transforms with different widths raises:Following review feedback, this now matches the Java
Truncate.satisfiesOrderOf: a truncate transform satisfies the order of another truncate transform when its width is greater than or equal to the other's. It no longer reads the missingsource_type.I left the
source_typeproperty in place to avoid an API change.This picks up the same bug as #3681, #3682 and #3854, which the stale bot closed.
Are these changes tested?
Yes.
test_truncate_satisfies_order_of_different_widthsintests/test_transforms.pycovers equal widths, both directions of different widths, and other transform types.tests/test_transforms.pypasses locally, and ruff check and ruff format pass.Are there any user-facing changes?
TruncateTransform(a).satisfies_order_of(TruncateTransform(b))now returnsa >= binstead of raisingAttributeErrorwhena != b.This change was prepared with an AI coding assistant, and the tests were run locally. The commits have a
Generated-by:trailer, following the ASF generative tooling guidance.