Skip to content

Fix truncate transform ordering comparison#3681

Open
mattfaltyn wants to merge 1 commit into
apache:mainfrom
mattfaltyn:agent/fix-truncate-transform-ordering
Open

Fix truncate transform ordering comparison#3681
mattfaltyn wants to merge 1 commit into
apache:mainfrom
mattfaltyn:agent/fix-truncate-transform-ordering

Conversation

@mattfaltyn

Copy link
Copy Markdown

Closes #3680

Rationale for this change

TruncateTransform.satisfies_order_of accessed the uninitialized _source_type attribute when comparing truncate transforms with different widths, raising AttributeError instead of returning a boolean.

Compare truncate widths directly, consistent with the Apache Iceberg Java implementation.

Are these changes tested?

Yes. Added regression coverage for both wider-to-narrower and narrower-to-wider comparisons.

  • uv run python -m pytest tests/test_transforms.py -q (283 passed)
  • make lint
  • make test PYTEST_ARGS=-q (3,768 passed; 1,560 deselected)

Are there any user-facing changes?

Yes. Comparing truncate transforms with different widths now returns the expected boolean instead of raising AttributeError.

@mattfaltyn
mattfaltyn marked this pull request as ready for review July 18, 2026 07:24
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.

TruncateTransform.satisfies_order_of raises AttributeError for different widths

1 participant